[[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
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.
http://www.idev101.com/code/Distribution/build.html
http://www.weston-fl.com/blog/?p=2442
http://stackoverflow.com/questions/5265772/archives-not-showing-up-in-organizer-for-xcode-4
Yes this is my first post!!
Cool eh.
Welcome to WordPress.com. After you read this, you should delete and write your own post, with a new title above. Or hit Add New on the left (of the admin dashboard) to start a fresh post.
Here are some suggestions for your first post.
- You can find new ideas for what to blog about by reading the Daily Post.
- Add PressThis to your browser. It creates a new blog post for you about any interesting page you read on the web.
- Make some changes to this page, and then hit preview on the right. You can always preview any post or edit it before you share it to the world.