I am incredibly confused, and If I am doing anything not according to the book I deserve a big slap in the face for moaning about this.
I am adding all the code from page 247 to AppDelegate.m, and as soon as I run the app in iOS simulator I get a SIGABRT error in Main.m:
2016-03-27 18:17:48.019 Idoodle[2519:394907] *** Assertion failure in -[UIApplication _runWithMainScene:transitionContext:completion:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit_Sim/UIKit-3512.60.7/UIApplication.m:3401
2016-03-27 18:17:48.021 Idoodle[2519:394907] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Application windows are expected to have a root view controller at the end of application launch'
*** First throw call stack:
(
0 CoreFoundation 0x000000010cf3fd85 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010c9b3deb objc_exception_throw + 48
2 CoreFoundation 0x000000010cf3fbea +[NSException raise:format:arguments:] + 106
3 Foundation 0x000000010c5fdd5a -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 198
4 UIKit 0x000000010d2f4ab6 -[UIApplication _runWithMainScene:transitionContext:completion:] + 3127
5 UIKit 0x000000010d2f1714 -[UIApplication workspaceDidEndTransaction:] + 188
6 FrontBoardServices 0x000000010fd5e8c8 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 24
7 FrontBoardServices 0x000000010fd5e741 -[FBSSerialQueue _performNext] + 178
8 FrontBoardServices 0x000000010fd5eaca -[FBSSerialQueue _performNextFromRunLoopSource] + 45
9 CoreFoundation 0x000000010ce65301 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
10 CoreFoundation 0x000000010ce5b22c __CFRunLoopDoSources0 + 556
11 CoreFoundation 0x000000010ce5a6e3 __CFRunLoopRun + 867
12 CoreFoundation 0x000000010ce5a0f8 CFRunLoopRunSpecific + 488
13 UIKit 0x000000010d2f0f21 -[UIApplication _run] + 402
14 UIKit 0x000000010d2f5f09 UIApplicationMain + 171
15 Idofuckingdoodle 0x000000010c4b29af main + 111
16 libdyld.dylib 0x000000010f71992d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Although Xcode 7 doesn’t contain Empty application project, I even downloaded it online just to check if that was the problem. The application didn’ t work with an Empty project or single view.
It appears that the app has a problem with this statement if it helps, although it’s only the third one I can get the application to launch if I comment out all code including/following this statement:
I would appreciate a fast response as I have been reading this book on and off for years and I finally want to finish it, and I don’t want to have to put it down again!!
Running Xcode 7.3, El Capitan 10.11.4 (Hackintosh)