Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS

im so confused (me being stupid again!)

Well whenever I've done an IOS course it has always like always gone wrong when i follow along and I'm not sure why... there all seems to be a problem with my main.C and I've done the crystal ball and blog reader and now doing core date one.. anyone know why? I've never been able to fix it..

3 Answers

Hey Ben,

What is the error message that you are receiving?

" 2014-06-24 07:05:54.782 Diary[452:60b] The app delegate must implement the window property if it wants to use a main storyboard file. 2014-06-24 07:05:54.785 Diary[452:60b] -[THAppDelegate window]: unrecognized selector sent to instance 0xa1402e0 2014-06-24 07:05:54.825 Diary[452:60b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[THAppDelegate window]: unrecognized selector sent to instance 0xa1402e0' *** First throw call stack: ( 0 CoreFoundation 0x01b541e4 exceptionPreprocess + 180 1 libobjc.A.dylib 0x018d38e5 objcexception_throw + 44 2 CoreFoundation 0x01bf1243 -[NSObject(NSObject) doesNotRecognizeSelector:] + 275 3 libobjc.A.dylib 0x018e5965 -[NSObject forwardInvocation:] + 68 4 CoreFoundation 0x01b442da _forwarding + 458 5 CoreFoundation 0x01b440ee CF_forwarding_prep_0 + 14 6 Diary 0x0000378e -[THAppDelegate application:didFinishLaunchingWithOptions:] + 110 7 UIKit 0x0058d14f -[UIApplication handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 309 8 UIKit 0x0058daa1 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1810 9 UIKit 0x00592667 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 824 10 UIKit 0x005a6f92 -[UIApplication handleEvent:withNewEvent:] + 3517 11 UIKit 0x005a7555 -[UIApplication sendEvent:] + 85 12 UIKit 0x00594250 _UIApplicationHandleEvent + 683 13 GraphicsServices 0x03a07f02 _PurpleEventCallback + 776 14 GraphicsServices 0x03a07a0d PurpleEventCallback + 46 15 CoreFoundation 0x01acfca5 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION + 53 16 CoreFoundation 0x01acf9db __CFRunLoopDoSource1 + 523 17 CoreFoundation 0x01afa68c __CFRunLoopRun + 2156 18 CoreFoundation 0x01af99d3 CFRunLoopRunSpecific + 467 19 CoreFoundation 0x01af97eb CFRunLoopRunInMode + 123 20 UIKit 0x00591d9c -[UIApplication _run] + 840 21 UIKit 0x00593f9b UIApplicationMain + 1225 22 Diary 0x00003a9d main + 141 23 libdyld.dylib 0x0219b701 start + 1 24 ??? 0x00000001 0x0 + 1 ) libc++abi.dylib: terminating with uncaught exception of type NSException (lldb) "

Try deleting the commented out code below in your THAppDelegate.m file:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
//    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
//    // Override point for customization after application launch.
//    self.window.backgroundColor = [UIColor whiteColor];
//    [self.window makeKeyAndVisible];
    return YES;
}