"Applications are expected to have root view..."


#1

The first iOS app in chapter 27 does work (hooray) but I receive this error(?) while the app runs:

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

I think I know what this means but wanted to check in with the boss first: by choosing the “Blank Application” template we decided
not to use a root view controller? Will this message go away when we choose the “Single View Application” template?

– Pete in Indy


#2

Hmm. I think the latest Xcode came with new template projects.

Overall, ignore this warning – when you read “iOS Programming: The Big Nerd Ranch Guide,” you’ll know why this happened.

Yes, the Single View template would have prevented this warning, but there would have been a few more classes and xib files. I tried to keep this one really, really simple.


#3

For those newbies like myself. Using the “Single View Application” template works great (no root view controller errors). With using the Single View Application, write the exact same code into the …ViewController class, ( not the appDelegate).
Changes for the viewController:

  1. Omit all declaration references of “UIWindow” (theWindow and window), in that class, since it is declared in the root controller.
  2. Change all messages sent to “window”, to “view”.

#4

I quote AH’s reply:

“Overall, ignore this warning – when you read “iOS Programming: The Big Nerd Ranch Guide,” you’ll know why this happened.”

Why did it happen? I have gone through the chapter 27 yet I am unable to figure out why it happened.


#5

When reading the Objective-C book, you can safely ignore this warning. The purpose of the whole book and Ch 27 for that matter is not to teach you iOS programming but to give you a glimpse of what’s to come. But if you are curious, you can start reading the View Programming topics for iOS or Cocoa in Apple’s documentation to get ahead of the book.

Also, you will meet the view controllers and the root view controller if and when you start reading the iOS book.


#6

OK, thank you very much, that’s cleared things up.


#7

Mine doesnt seve the tasks when i kill the app (double tab on home button and kill app) when I do it, it jumps to xcode with error
Application windows are expected to have a root view controller at the end of application launch
(lldb)

why it doesnt save my tasks?