• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Is showWindow supposed to call init?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Is showWindow supposed to call init?


  • Subject: Is showWindow supposed to call init?
  • From: Jerrod Fowkes <email@hidden>
  • Date: Wed, 7 Jun 2006 06:25:53 -0700 (PDT)

Hi,

I have subclassed NSWindowContoller. I am using it for a preferences panel. in my application controller I have a method that gets called by the menu to show the panel.

I need to run some methods first in my preferences controller first before I do some loading, so I put this in my awakeFromNib method in my application contoller.

preferencesController = [[PreferencesController alloc] init];
[preferencesController runMyMethod];

pretty straightforward. At this point I haven't released the preferencesContoller at all so it should still be in memory and I should still be able to access that instance with this:

[preferencesContoller showWindow];

that is the only thing in the method when I click on the menu to show the window. However, when I do that It calls init in my PreferencesContoller class. Which is NOT what it should be doing. It should be accessing the preferencesController instance.

Is there something here that I don't get, because this obviously doesn't follow the norm. I haven't been able to find documentation on-line. I do know that Apple's documentation says :

"Displays the window associated with the receiver." Which is misleading, because it wants to create another receiver and display THAT window.
-Jerrod Fowkes

 __________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Is showWindow supposed to call init?
      • From: "Finlay Dobbie" <email@hidden>
  • Prev by Date: Making an NSProgressIndicator react as an NSControl
  • Next by Date: Re: Is showWindow supposed to call init?
  • Previous by thread: Re: Making an NSProgressIndicator react as an NSControl
  • Next by thread: Re: Is showWindow supposed to call init?
  • Index(es):
    • Date
    • Thread