Re: Subclassing NSArrayController?
Re: Subclassing NSArrayController?
- Subject: Re: Subclassing NSArrayController?
- From: Ron Lue-Sang <email@hidden>
- Date: Tue, 19 Aug 2008 07:37:52 -0700
Subclass and override newObject which is declared in
NSObjectController.h
You can set any properties you like from there.
---------------------
RONZILLA
On Aug 19, 2008, at 7:27 AM, Chris Poliquin <email@hidden>
wrote:
Hi,
I have an ArrayController in IB to manage an array of NSObjects (a
custom class) for a TableView. When a new item is inserted via a
button connected to insert: a new instance of my class is created
and appears in the table. However, I want to be able to control the
property values of the new object at the time it is created.
So, my class has a property called timeString. The timeString is
different for each object and is based on the time showing on a
stopwatch (NSTextField) when the object is created. Do I need to
subclass NSArrayController and override the insert method in order
to deal with getting this value and assigning it to the object at
creation or would Key Value Observing in my Controller class be more
effective? What is the standard way of doing this? Perhaps there
is a way to bind the new object's property to the NSTextField value
via IB and still make it so it never changes?
Best Regards,
Chris Poliquin
-----------------------------
email@hidden
www.chrispoliquin.com
_______________________________________________
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
_______________________________________________
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