Build error - Root View controller?


#1

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 Whereami.app (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?

Thanks,

  • Malik

#2

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.


#3

Ran into the same issue here.

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

http://cupsofcocoa.com/2011/09/24/the-jungle-part-1/

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

Owen


#4

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


#5

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

Owen


#6

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


#7

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.


#8

Bump.

Am I missing something or barking up the wrong tree?


#9

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.