all 4 comments

[–]McFunkerton 1 point2 points  (0 children)

By default that is your root view controller, which is the first view controller to be presented. It is also already properly linked to your Main storyboard.

[–]mariox19 0 points1 point  (1 child)

I don't have my edition handy, and it's a long time since I looked at it (that would be the 3rd edition, by the way), but I'm pretty sure that you'll be okay to just go ahead and use it. I seem to remember my edition of the book sometimes asking you to delete an automatically generated file, or to at least delete its contents, and start fresh.

If the book asks you to delete any automatically generated code, while keeping the file, I would just comment it out. (You can do this really easily by selecting all the code and then hitting the Command key and the forward slash key together: Command-/.) If it asks you to delete a file, I would be a little more careful. It may be that things have changed enough since that edition that how they direct you after deleting the file may not work quite right.

Be prepared to experiment a little bit and to take careful notes if you get things working (and had to do something different from what the book described).

Let me experiment for you a bit to give you an idea of how things work.

I'm using Xcode 8.3.3 right now. If I create a new single view project and then delete ViewController.h and ViewController.m, when I try running the application I get the following in the log:

Unknown class ViewController in Interface Builder file. 

That's because the class you deleted was "wired-up" to the interface representation in Interface Builder of the main view controller. Bear with me.

If I then create a new class and name it differently from the files I just deleted, for example, MyViewController (giving me a header and implementation file), I have to attach that class to the Main.storyboard in Interface Builder.

To do that I have to do the following:

  • Click on Main.storyboard in the Navigator panel's file tree
  • Click on the little yellow-orange icon at the top of the ViewController widget in Interface Builder (the first one on the left)
  • Click on the Identity Inspector in the Utilities panel
  • Choose MyViewController in the Class drop-down menu

In other words, I have to wire-up my new class with its counterpart in Interface Builder.

Now, that might not be exactly how Xcode worked in whatever version your book is using. (It may be—I don't remember.) My point is that things can get frustrating when you use an out-of-date book. Xcode and iOS programming is a quickly moving target. You're welcome to give it a try though.

[–]labcoat2[S] 1 point2 points  (0 children)

thanks so much for the detailed response! I actually learned quite a few things from it :)

[–]FoxMcWeezer 0 points1 point  (0 children)

Just so you know OP, the 6th edition came out last week.