• 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
Re: Why would IBOutlet NSPanel *aWindow be nil?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why would IBOutlet NSPanel *aWindow be nil?


  • Subject: Re: Why would IBOutlet NSPanel *aWindow be nil?
  • From: Dale Gillard <email@hidden>
  • Date: Sun, 10 Apr 2005 23:24:37 +1000

On 9 Apr 2005, at 10:52 PM, I wrote:

I've an existing Nib file to which I've added a new NSPanel. That is, I've added an outlet to the IB instance, dragged and connected the instance to the panel, and then added the IBOutlet reference to the .h file using the code, IBOutlet NSPanel *aPanel.

But... when I run the project the new panel does not appear when I send it a makeKeyAndOrderFront: message. I've run the app in the debugger and the outlet is nil. Is there something I'm doing wrong? Thanks.

More info: If I send a makeKeyAndOrderFront: message in awakeFromNib then the NSPanel is displayed. But if I send the message later from a different method the NSPanel does not appear. It's like Cocoa is not retaining the outlet?! And it has me wondering whether I need to retain the outlet in some way.


In this case I'm launching the app, doing some stuff, and then creating anInstance with the [aClass alloc] init] messages. (The .h file for aClass contains the outlet pointing to a NSPanel.) I send some message to anInstance, including asking it to send its outlet the makeKeyAndOrderFront: message to display the NSPanel. Every message works fine, and the NSPanel outlet is nil so it fails to send the makeKeyAndOrderFront: message.

Why is the outlet being initialised in awakeFromNib, but being released before I can create an instance of the class which contains the outlet? Any advice would be appreciated. I'm stumped!

Dale.

_______________________________________________
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: Why would IBOutlet NSPanel *aWindow be nil?
      • From: Scott Ahten <email@hidden>
    • Re: Why would IBOutlet NSPanel *aWindow be nil?
      • From: "John C. Warner" <email@hidden>
References: 
 >Why would IBOutlet NSPanel *aWindow be nil? (From: Dale Gillard <email@hidden>)

  • Prev by Date: scrolling down a page in table view
  • Next by Date: Re: Runtime error with ABPeoplePickerView
  • Previous by thread: Re: Why would IBOutlet NSPanel *aWindow be nil?
  • Next by thread: Re: Why would IBOutlet NSPanel *aWindow be nil?
  • Index(es):
    • Date
    • Thread