small medium large xlarge

Generic-user-small
03 Jan 2012, 03:48
Paul Brady (1 post)

So close to the end of the book, and I’m stuck. On page 397, I added the code to the @applicationDidFinishLaunching@ method, but it doesn’t seem to work. The method is now @(BOOL)@ rather than @(void)@ and there appear to have been many significant changes to the method since the book was published. I put the code right after the comments, @”// Override point for customization after application launch.”@ All my other code seems to work fine. There are no errors when I build and run, just no “Hello World!” as the default message when I first tap the button. Any ideas?

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {    
    
    // Override point for customization after application launch.
	NSDictionary *initialDefaults = [NSDictionary dictionaryWithObject:@"Hello World!" forKey:@"kMessageString"];
	[[NSUserDefaults standardUserDefaults] registerDefaults:initialDefaults];
	
	// Set the main view controller as the window's root view controller and display.
    self.window.rootViewController = self.mainViewController;
    [self.window makeKeyAndVisible];
	
    return YES;
}
You must be logged in to comment