Re: NSArrayController and the ContentArray Binding
Re: NSArrayController and the ContentArray Binding
- Subject: Re: NSArrayController and the ContentArray Binding
- From: Steven Kramer <email@hidden>
- Date: Sun, 10 Oct 2004 22:57:58 +0200
Op 10-okt-04 om 14:55 heeft Paul Sargent het volgende geschreven:
So I think my question is (but maybe my understanding of everything is
incorrect), how do I either:
a) specify a class which is instantiated in the NIB to the
contentArray binding? (i.e. what would it's class path be from
NSApplication)
b) specify some class other than File's Owner from the binding
inspector panel?
c) add the instance to the NSApplication class? (I would assume
sub-classing it, but then I need to inform IB to use the subclass.
How?)
a) use some object reachable by KVC from NSApp, say [File's
Owner]delegate.detailsArray - this assuming you have an object of yours
that contains the detailsArray set up as the application's delegate.
This is the preferred way. Connect the delegate in code or (preferably)
by telling IB about your delegate's class, instantiate it in IB and
connect it up as the delegate.
b) No, but you could instantiate a class of your own in IB and connect
the NSArrayController's "content" outlet
c) Subclass NSApplication as MyApplication (and add your array) - open
'classes' tab - "Read Files" from Classes menu - choose MyApplication.h
- go to instances tab - click on File's Owner - Alt + 5 - select
MyApplication
Read up a bit on how stuff works in Interface Builder before
progressing. All your solutions will work (as shown above) but you'll
need to learn more about using and instantiating custom classes. Apple
documentation on this topic is abundant.
Steven
--
email@hidden
http://sprintteam.com/
_______________________________________________
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