• 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
How to get references to objects created from nib files?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to get references to objects created from nib files?


  • Subject: How to get references to objects created from nib files?
  • From: Ken Tozier <email@hidden>
  • Date: Mon, 24 Jun 2002 22:12:50 -0400

I'm finishing up an outline data source and need to find a way to store a reference of the NSOutlineView that is created from the nib file.

Some of the data in the outline is updated dynamically without input from the user and I need this reference in order to send it a refreshItem message. I figured out a hack way to do it by setting my data source's NSOutlineView instance variable inside calls to one of the required data source routines:

- (int) outlineView:(NSOutlineView *) outlineView numberOfChildrenOfItem:(id) item
- (BOOL) outlineView:(NSOutlineView *) outlineView isItemExpandable:(id) item
etc...

Grab the outline reference like so

if (myOutlineRef == nil)
myOutlineRef = outlineView;

This seems awfully wasteful though as the same test is performed every time one of these routines is called and it really only needs to be done once.

Is there another way to just grab the reference once say in the awakeFromNib method?

Thanks,

Ken Tozier
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: How to get references to objects created from nib files?
      • From: Brent Gulanowski <email@hidden>
  • Prev by Date: My object won't alloc.
  • Next by Date: large numerical arrays
  • Previous by thread: Re: My object won't alloc.
  • Next by thread: Re: How to get references to objects created from nib files?
  • Index(es):
    • Date
    • Thread