Second window

Discussion in 'Mac Programming' started by larswik, Jul 22, 2011.

  1. larswik macrumors 68000

    Sep 8, 2006
    I am going nuts trying to understand this second window opening so I am uploading a compressed file of the project. I hope someone can open it up and identify why that second window is not opening.

    Attached Files:

  2. jiminaus macrumors 65816


    Dec 16, 2010
    You're not getting the second window opening because instead of sending generateWindow to the secondWindow instance you set up in the XIB, you create a new one in openNewWindowAppDelegate's openWindowButton method and send generateWindow to that.

    This new instance isn't the one who's secondInfoWindow outlet is connect to the 2nd window in your MainMenu.xib. You'll find that this outlet is in fact nil for this new instance because you never it set to be anything else. It's the separate and different instance of secondWindow in your XIB who's outlet has been connected.

    With this kind of arrangement, you'll need to connect the secondWindow instance in your XIB to an outlet in openNewWindowAppDelegate so that openNewWindowAppDelegate's openWindowButton can send generateWindow to correct instance of secondWindow.

    And please name your apps and classes with initial capital letters.
  3. larswik thread starter macrumors 68000

    Sep 8, 2006
    Thanks for answering again Jim. This is like self = [super init]. When I get home from lunch I will open it up and walk through your explanation.

    "And please name your apps and classes with initial capital letters."

    will do.
  4. larswik thread starter macrumors 68000

    Sep 8, 2006
    I looked it over and I am still confused so I think at this point I am going to stop working on my own big project and start the Mac OSX recipes book I mentioned. Last night I finished the Objective - C for absolute beginners, it was a OK book but lots of typos and wrong code. hopefully the second edition will fix those things.

    You guys have been VERY generous answering my same question from me over and over again. So I will dig into this new book and put my project on hold till I can better understand what I am doing wrong. I would love just 10 minutes with an expert over my shoulder pointing everything out that I am doing wrong. So, I am looking forward to my Java class next month!

    thanks sooo much for your patients.

Share This Page