Setting style of UITableViewCell when using iOS 6 UITableView dequeueReusableCellWithIdentifier:forIndexPath:

I know you said you didn’t want to create a subclass, but it looks inevitable. Based on the assembly code while testing in the iOS 6.0 simulator, UITableView creates new instances of UITableViewCell (or its subclasses) by performing [[<RegisteredClass> alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:<ReuseIdentifier>] In other words, the style sent (UITableViewCellStyleDefault) appears to be hard-coded. To get … Read more

How to switch to different Storyboard for iPhone 5?

I was looking for the same answer couple of weeks ago here’s my solution hope helps.. -(void)initializeStoryBoardBasedOnScreenSize { if ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPhone) { // The iOS device = iPhone or iPod Touch CGSize iOSDeviceScreenSize = [[UIScreen mainScreen] bounds].size; if (iOSDeviceScreenSize.height == 480) { // iPhone 3GS, 4, and 4S and iPod Touch 3rd and … Read more

Attempt to present * on * whose view is not in the window hierarchy

You can’t display a modal view controller from the appDelegate. You need to display a modal ViewController from whichever viewController is currently displaying full-screen. In other words, you need to put that code into your root view controller, or whichever one you want to display the modal vc from… Also, you’ll want to use the … Read more

Replacement for “purpose” property of CLLocationManager

The replacement for the purpose property in iOS 6 is a new Info.plist key named NSLocationUsageDescription (aka “Privacy – Location Usage Description”). The key is documented in the Information Property List Key Reference but unfortunately it’s not mentioned with the deprecation note of the purpose property. However, the CLLocationManager.h does have this comment: * Deprecated. … Read more

Sharing with iOS 6.0 native Facebook integration: “Posted via my app name”?

UPDATE – it can be done So the Digg for iOS app is able to share to Facebook without using the Accounts framework to get user permissions… They use UIActivityViewController and have the post appear as “via Digg”, I contacted someone from Digg and they told me that it’s a manual process, you must have … Read more

UICollectionView Assertion failure

I ran into this very same problem when inserting the first cell into a collection view. I fixed the problem by changing my code so that I call the UICollectionView – (void)reloadData method when inserting the first cell, but – (void)insertItemsAtIndexPaths:(NSArray *)indexPaths when inserting all other cells. Interestingly, I also had a problem with – … Read more

nib but didn’t get a UITableView

If you have a NIB for the UITableViewController subclass then its view outlet must be hooked up to a UITableView. You’re right to delete MainListViewController.xib and do it all in code, but the reason it didn’t work for you is because the old XIB will not be deleted when you build & run. So, delete … Read more

Could not insert new outlet connection [duplicate]

I got the same problem as you today… I think this is a bug of Xcode, below is the way to fix the issue: Close the project you are working on with. Delete your project’s【DerivedData】folder. (This folder may inside your project’s folder, or inside ~/Library/Developer/Xcode/DerivedData/(your project)/ ) or somewhere else that was setup by you. … Read more

tech