Fundamentally, the problem is that you're expecting data to be in NSUserDefaults. On first launch, NSUserDefaults returns nil for the keys you access, and passing this nil result through later code causes exceptions to be thrown. The solution is to register defaults with NSUserDefaults upon application startup:
@implementation AppController
+ (void)initialize
{
NSDictionary *defaultValues = @{@"SomeKey" : @"DefaultValue"};
[[NSUserDefaults standardUserDefaults] registerDefaults:defaultValues];
}
@end