Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Problem in Lesson 11: Presidents

RE: XCODE v6.3.2 (not looking at any of the iOS 9 stuff yet)

In the MasterViewController.swift file, in the "prepareForSegue" method, there is the following code:

     if let oldController = detailViewController {

        controller.languageString =

             oldController.languageString

     }


I'm getting an error in this code when I try to build the project: "'DetailViewController' does not have a member named 'languageString'"

I thought somewhere in my source code for the DetaiViewController I was missing a declaration of the "languageString" variable, but I can't find that anywhere in the example code and I'm not savvy enough (yet) to learn how to look for "members" in the "ViewController" class, of which DetailViewController is a subclass.

Any pointers would be helpful.

Thanks, Rich Parker

Comments

  • Okay...the book led me astray by referring to a variable that hadn't yet been created in the part of the chapter that I had completed. I see from the completed example code that the "languageString" is, indeed, defined as a variable in the DetainViewController.swift file.

    So, asking me to run the app at the phase that I had completed coding, was an error. I just didn't yet have enough information to figure out why it wouldn't compile and run.

    In the future, as I read the book and write its code, I'll compare what I have with the example code to see whether I'm on the right track.

    Thanks for viewing my problems. Hopefully, in the future, I'll be posting more relevant issues.

    -Rich Parker
Sign In or Register to comment.