developer

library not found for -lPods

Question: ❓❓❓ I got an error when archiving a project. This is my environment. Mac OS Lion Xcode 4.3.1 iOS SDK 5.1 The project deployment target is: IPHONEOS_DEPLOYMENT_TARGET 3.2 The error shows: ld: library not found for -lPods clang: error: linker command failed with exit code 1 (use -v to Read more…

By admin, ago
developer

Convert an NSURL to an NSString

Question: ❓❓❓ I have an app where the user can choose an image either from the built-in app images or from the iphone photo library. I use an object Occasion that has an NSString property to save the imagePath. Now in the case of the built-in app images I do Read more…

By admin, ago
developer

UILongPressGestureRecognizer gets called twice when pressing down

Question: ❓❓❓ I am detecting if the user has pressed down for 2 seconds: UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleLongPress:)]; longPress.minimumPressDuration = 2.0; [self addGestureRecognizer:longPress]; [longPress release]; This is how I handle the long press: -(void)handleLongPress:(UILongPressGestureRecognizer*)recognizer{ NSLog(@"double oo"); } The text “double oo” gets printed twice when I press Read more…

By admin, ago
developer

Assertion failure in dequeueReusableCellWithIdentifier:forIndexPath:

Question: ❓❓❓ So I was making an rss reader for my school and finished the code. I ran the test and it gave me that error. Here is the code it’s referring to: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier Read more…

By admin, ago
developer

Use of alloc init instead of new

Question: ❓❓❓ Learning Objective-C and reading sample code, I notice that objects are usually created using this method: SomeObject *myObject = [[SomeObject alloc] init]; instead of: SomeObject *myObject = [SomeObject new]; Is there a reason for this, as I have read that they are equivalent? Good Answer: 👌👌👌 There are Read more…

By admin, ago