Category Archives: iPhone - Page 3

How to enable “swipe to delete” for UITableViewCell

- (UITableViewCellEditingStyle)tableView:(UITableView *)aTableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath
{
// No editing style if not editing or the index path is nil.
if (self.editing == NO || !indexPath) return UITableViewCellEditingStyleDelete;
}

Why “shouldAutorotateToInterfaceOrientation” doesn’t Work

The following is from Apple’s Technical Q&A:

  • All child view controllers in your UITabBarController or UINavigationController do not agree on a common orientation set.
  • Overriding the -(id)init: or -(id)initWithNibName:(NSString *)nibName bundle:(NSBundle *)nibBundle method without calling super. For the object to be initialized properly, you must call super on any init or initWithNibName method you are overriding for your view controllers.

For more detail please see:

Why won’t my UIViewController rotate with the device?

How to make iPhone app icon without borders

Open up the project in Xcode, open the Info.plist file, add a new row and choose “Icon already includes gloss and bevel effects” and checkmark it (set to true).

The original solutions can be found here:

http://forums.macrumors.com/showthread.php?t=747874

Get a list of the languages that iPhone supports

NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSArray *languages = [defaults objectForKey:@"AppleLanguages"];
NSLog(@"%@", languages);