Build error - Root View controller?


Hi There,

I am using Xcode 4.2 and have downloaded and installed the ‘Window Based Template’ fix and that seems to work sweet.

However when initially trying to build (page 82) I only get this message at the console:

‘Applications are expected to have a root view controller at the end of application launch’

Am I something doing wrong?


  • Malik


I get this same exact error. I’m not sure how to progress from here. It seems like we need to define a root view controller, but when I do that an instantiate it, the view is no longer the mapview, it’s just a white screen. I’m not sure what the proper way to solve this is.


Ran into the same issue here.

The steps described in the “The Root View Controller” section of this post resolved this issue for me.

That said, I’m not sure if doing this will have any repercussions in any of the forthcoming chapters.



I get the same thing! I’ll have a look at the link.


Looks like that code causes a problem with the chapter 5 work. The UITextField was not selectable. Removed the root view controller code from and the UITextField works. I still get that root view controller error, but meh. It works fine with it.



See this: viewtopic.php?f=76&t=3774


I’m also stuck here.

After looking at the downloaded reference chapter 4 code(and the book) and running this code successfully on Xcode 4.2.1 , I compared my written code with the reference code(and the book) and the difference was this line (just pointing out ‘WhereamiAppDelegate.h’)

reference code chapter 4

my written code

When I create a window-based-application (installed the recommend patch) the delegate is not a subclass of NSObject and creates UIResponder instead. This is clearly seen above.

Someone please shed some light here.



Am I missing something or barking up the wrong tree?


I got this working now using the window-based-app patch and rewriting my code. I must have had a typo somewhere. The code still doesn’t correspond though.