Tag: xcode

Custom actions for UIGestureRecognizers (with custom parameters)

Short version of my problem: I cannot figure out how to make the “action” for my UITapGestureRecognizer take additional parameters, and actually use them. Here’s the rundown of my problem: I am trying to make it so that my iPad app records (with NSLog) the coordinates of the UITouch that occurs whenever they press one […]

Why there is an invalid context error?

Here is the code I use to draw: – (void) drawSomething { CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSetRGBStrokeColor(context, 1, 0, 0, 1); CGContextSetLineWidth(context, 6.0); CGContextMoveToPoint(context, 100.0f, 100.0f); CGContextAddLineToPoint(context, 200.0f, 200.0f); CGContextStrokePath(context); NSLog(@”draw”); } But I got the error like this: [Session started at 2010-04-03 17:51:07 +0800.] Sat Apr 3 17:51:09 MacBook.local MyApp[12869] <Error>: CGContextSetRGBStrokeColor: invalid context […]

Xcode 8 Autocomplete Broken – Displays only limited User code snippets – Know why?

This just started today. Autocomplete had been working fairly well and then started sputtering, only showing autocomplete for some standard Cocoa classes / methods etc. Best described as periodic strange omissions. I am using Cocoa & Objective C but it seems to be broken for more than just Objective C. I deleted the derived data […]

Always loading saved data, and properly writing if function

I need to load user data, but I need to do it looped. (always loading). My code is NSString *savedValue = [[NSUserDefaults standardUserDefaults] stringForKey:@”preferenceName”]; And also, whenever I make an if function, for example if (t1activity == “active”) { //code here } I get an error saying Expected identifier or ‘(‘ Thanks so much! (objective-c)

Watching variables in Xcode

I’m trying to watch a variable with Xcode. I’m following the instructions in here by pausing at a breakpoint, selecting Run > Variables View > …. but with the exception of “Enable Data Formatters” the rest of the options are all greyed out. Any ideas? I’m using Xcode version 3.1.3.

UICollectionView Vertical Paging With Code In Objective-C

I have a ViewController mycollectionview and create a UICollectionView collection view in it and set size to the frame size. I have a Custom UICollectionViewCell CollectionViewCell class. Images sizes are different and I want to just show a one cell at the same time (when not scrolling). Here is mycollectionview code : – (void)viewDidLoad { […]

Error compiling for unit test using google toolbox for mac

Hi my application runs fine but when I try to run the unit tests I am getting this error… 2010-10-19 00:27:49.919 AssignmentUnitTest[27988:903] *** Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘*** -[NSURL initFileURLWithPath:]: nil string parameter’ Irony is I have searched the whole project & I dont have any similar line of code that […]

how to set the selected check mark as ticked in tableview cell swift 3.0

I am using one UITableView to select the country with tick mark. But when I move to other screen and when I come back my check mark is invisible. It seems like the country what I am selecting is fine, But after I move to other screen an come back, The selected tick mark is […]

iOS: Autosizing an UIImage programmatically

I have an UIImage in my app, and I had to uncheck the auto layout box and set autosizing with the options shown in the image below so the image will show properly in both screen sizes (3.5 inch, and 4 inch) My question is, how can I set these options in code? I tried […]

How to make a mac application support both 32bit and 64 bit systems

I have created one mac application. It is showing 64bit as system requirement. but the app can run in 32bit systems also. When I checked the Build Settings of the application. I found: Valid Architecture : i386 x86_64 and according to my knowledge these are intel based 32/64bit systems. But I want to make my […]