[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
NSLog(@"orientation: %d", [[UIDevice currentDevice] orientation]);
[[UIDevice currentDevice] endGeneratingDeviceOrientationNotifications];

It won't work on the simulator.

NSString *osVersion = [[UIDevice currentDevice] systemVersion];    

NSNumberFormatter *f = [[NSNumberFormatter alloc] init];

[f setNumberStyle:NSNumberFormatterDecimalStyle];

NSNumber * myNumber = [f numberFromString:@”42″];

You can set your boolean by using:

[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"logged_in"];

and read it by using this code:

if(![[NSUserDefaults standardUserDefaults] boolForKey:@"logged_in"]) {
    [self displayLogin];
} else {
    [self displayMainScreen];
Without ARC
int main(int argc, char *argv[]) { 
 NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 
 int retVal = -1; 
 @try { 
 retVal = UIApplicationMain(argc, argv, nil, nil); 

 @catch (NSException* exception) { 
 NSLog(@"Uncaught exception: %@", exception.description); 
 NSLog(@"Stack trace: %@", [exception callStackSymbols]); 

 [pool release]; return retVal; 

With ARC

int main(int argc, char *argv[])


@autoreleasepool {

//        return UIApplicationMain(argc, argv, nil, NSStringFromClass([MCAppDelegate class]));

int retVal = -1;

@try {

retVal = UIApplicationMain(argc, argv, nil, NSStringFromClass([MCAppDelegate class]));


@catch (NSException *exception) {

NSLog(@”Uncaught exception: %@”, exception.description);

NSLog(@”Stack trace: %@”, [exception callStackSymbols]);


@finally {



return retVal;



Source: http://stackoverflow.com/questions/8100054/no-exception-stack-trace-in-console-under-xcode-4-2-ios-5

1. In your Xcode project, under the Supporting Files group, add a new Localization.string file. Right click on Supporting Files then New File… Then Resources then Strings File.

First, you need an iOS Dev Center account that has the role Agent or Admin to distribute apps.

1. Logon to the iOS Dev Center (here).

2. Go in the iOS Provisioning Portal.

3. Go to Certificates section and Distribution tab. Make sure you have a valid certificate. If you don’t, follow this guide to get one, then come back here.

4. Go to the App IDs section and add a new App ID for the app you want to distribute. Note: It is one App ID per app, so if you already created one for your app, skip this step.