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

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

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

preferredInterfaceOrientationForPresentation must return a supported interface orientation

Your code should look like this: -(BOOL)shouldAutorotate { return NO; } -(NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationMaskLandscape; } – (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation { return UIInterfaceOrientationLandscapeRight; } Also, make sure in your Info.plist you have set the correct orientations for you app because what you return from supportedInterfaceOrientations is intersected with the Info.plist and if it can’t find a common … Read more

iOS6: supportedInterfaceOrientations not working (is invoked but the interface still rotates)

If your are using a UINavigationController as the root window controller, it will be its shouldAutorotate & supportedInterfaceOrientations which would be called. Idem if you are using a UITabBarController, and so on. So the thing to do is to subclass your navigation/tabbar controller and override its shouldAutorotate & supportedInterfaceOrientations methods.

Facebook authorization fails on iOS6 when switching FB account on device

Another answer gives a way to manually resync the device with the server. I defined a method called fbRsync to call this code. Make sure to #import <Accounts/Accounts.h> in your implementation file and then define this method: -(void)fbResync { ACAccountStore *accountStore; ACAccountType *accountTypeFB; if ((accountStore = [[ACAccountStore alloc] init]) && (accountTypeFB = [accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierFacebook] ) … Read more

GameCenter authentication in landscape-only app throws UIApplicationInvalidInterfaceOrientation

While writing this question and experimenting with code, it seems that I’ve found a solution: enable all orientations in project summary and remove application:supportedInterfaceOrientationsForWindow. Add this code to ViewController: – (NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationMaskLandscape; } Now it works seamlessly.

How do I set recipients for UIActivityViewController in iOS 6?

For adding subject to the email using UIActivityViewController on iOS6, this is the best solution that anyone can use.. All you have to do is call the following while initializing UIActivityViewController. UIActivityViewController *activityViewController = [[UIActivityViewController alloc] initWithActivityItems:activityItems applicationActivities:applicationActivities]; [activityViewController setValue:@”My Subject Text” forKey:@”subject”]; And your UIActivityViewController is populated with a subject.