Re: Subclassing NSArrayController?
Re: Subclassing NSArrayController?
- Subject: Re: Subclassing NSArrayController?
- From: Justin Giboney <email@hidden>
- Date: Tue, 19 Aug 2008 08:41:57 -0600
This is maybe an answer as well as a question.
Doesn't the bindings call the init method when creating a class
object? Couldn't you just overwrite the init method on your custom
class to set any necessary values?
Justin Giboney
On Aug 19, 2008, at 8:27 AM, Chris Poliquin 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