How to get references to objects created from nib files?
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.