Re: KVC Problems with Indexed Accessor for To-Many Properties
Re: KVC Problems with Indexed Accessor for To-Many Properties
- Subject: Re: KVC Problems with Indexed Accessor for To-Many Properties
- From: joe OneNinetyTwo <email@hidden>
- Date: Fri, 13 Oct 2006 18:28:24 -0700 (PDT)
Thanks Scott! Now it makes sense.
When I edit a table cell, the NSArrayController simply
updates the corresponding value inside the
NSMutableDictionary, and then sends a
objectInDataPointsAtIndex message, which was
overwriting my edit with an NSMutableDictionary object
created with the "faked" array.
I was thinking the NSArrayController would use
removeObjectFromDataPointsAtIndex followed by
insertObject:inDataPointsAtIndex when a table cell was
edited.
I don't really see how I can do what I want using an
NSArrayController. It looks like I'll have to
implement a data source for the NSTableView.
Philip
--- Scott Stevenson <email@hidden> wrote:
>
> On Oct 13, 2006, at 8:10 AM, joe OneNinetyTwo wrote:
>
> > My problem is: When I edit a value (cell) in the
> > table, once I hit return the cell goes back to
> it's
> > original value. I thought that my arrayController
> > would call removeObjectFromDataPointsAtIndex
> followed
> > by insertObject:inDataPointsAtIndex in this case,
> but
> > they never get called by the array controller.
>
> Editing a value in a table cell generally changes a
> property value of
> something *in* the array, not the array itself.
>
> If I have a table of "Person" objects and I enter a
> value for "First
> Name" in one of the rows, there's no need for the
> object to be
> removed and re-inserted in the array. It just
> updates the string
> value of firstName on that one object.
>
> - Scott
> _______________________________________________
> 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
>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.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