• 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: How does an instance variable in the ObjC code get connected to an interface element in the NIB file?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How does an instance variable in the ObjC code get connected to an interface element in the NIB file?


  • Subject: Re: How does an instance variable in the ObjC code get connected to an interface element in the NIB file?
  • From: Jens Alfke <email@hidden>
  • Date: Fri, 13 Jun 2008 20:23:04 -0700


On 13 Jun '08, at 2:21 PM, Paul Archibald wrote:

This puzzles me. I am tracing through some code in which I am looking at the value of some selected popup menu items. I am seeing the correct values for them, but I have to confess I don't know how the code is connected to the popup, or just why the code even works! I see the connections for the buttons on the interface, and I hit the breakpoints I expect, but I don't see any connections between the member variables and the popup items.

It happens when the nib is loaded. As the objects in the nib get created, their instance variables are set up to point to each other as described in the nib. This even applies to your controller object (the one that "owns" the nib), which exists before the nib is loaded — AppKit uses Obj-C introspection to look up its instance variables dynamically and change them to point to the objects from the nib.


—Jens

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >How does an instance variable in the ObjC code get connected to an interface element in the NIB file? (From: Paul Archibald <email@hidden>)

  • Prev by Date: Re: converting HTML causes crash
  • Next by Date: Re: PDFView's NSPrintPanel : Determine if Print / Cancel clicked?
  • Previous by thread: Re: How does an instance variable in the ObjC code get connected to an interface element in the NIB file? BACK ON TRACK
  • Next by thread: converting HTML causes crash
  • Index(es):
    • Date
    • Thread