Re: How to get references to objects created from nib files?
Re: How to get references to objects created from nib files?
- Subject: Re: How to get references to objects created from nib files?
- From: Brent Gulanowski <email@hidden>
- Date: Tue, 25 Jun 2002 09:33:58 -0400
On Monday, June 24, 2002, at 10:12 PM, Ken Tozier wrote:
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.
The simplest approach that I can think of: Add an outlet to the file's
owner for the NSOutlineView instance which resides in the nib, and make an
accessor method which can be called in the dataSource's -init method. If
the file's owner is not your class (if it's the NSApp), you could add an
application delegate object to the Nib and give it the instance variable,
and call [[[NSApp sharedApplication] delegate] myOutlineView] when the
data source is initialized. If the data source is *in* the Nib, you'd just
add an outlet to that. Likewise for the outline view's delegate, if you're
using it.
Brent
There are two kinds of people in the world, those who divide the kinds of
people in the world into two kinds, and those who don't.
_______________________________________________
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.