Re: Question about model observers

2010-05-12 Thread Quincey Morris
On May 12, 2010, at 13:07, Ken Thomases wrote: > There's no such thing as updating arrays or sets KVO-compliantly. (Again, I > speak in terms of their elements, not properties like count or description.) > You can only update to-many relationship properties of some other object, > which _mig

Re: Question about model observers

2010-05-12 Thread Ken Thomases
On May 12, 2010, at 2:39 PM, Quincey Morris wrote: > On May 12, 2010, at 11:04, Ken Thomases wrote: > >> On May 12, 2010, at 11:44 AM, Quincey Morris wrote: >> >>> *All* collections emit KVO notifications when their contents change, in the >>> sense of objects entering or leaving the collection

Re: Question about model observers

2010-05-12 Thread Quincey Morris
On May 12, 2010, at 11:04, Ken Thomases wrote: > On May 12, 2010, at 11:44 AM, Quincey Morris wrote: > >> *All* collections emit KVO notifications when their contents change, in the >> sense of objects entering or leaving the collection. Add, remove and replace >> for arrays, add and remove for

Re: Question about model observers

2010-05-12 Thread Ken Thomases
On May 12, 2010, at 11:44 AM, Quincey Morris wrote: > *All* collections emit KVO notifications when their contents change, in the > sense of objects entering or leaving the collection. Add, remove and replace > for arrays, add and remove for sets, set and remove for dictionaries. Arrays and set

Re: Question about model observers

2010-05-12 Thread Quincey Morris
On May 12, 2010, at 06:32, Keary Suska wrote: > On May 11, 2010, at 7:48 PM, Ken Thomases wrote: > >> On May 11, 2010, at 10:17 AM, Keary Suska wrote: >> >>> ... no collection will ever emit a KVO notification that its contents have >>> changed ... >> >> Depends on whether you consider a dicti

Re: Question about model observers

2010-05-12 Thread Keary Suska
On May 11, 2010, at 7:48 PM, Ken Thomases wrote: > On May 11, 2010, at 10:17 AM, Keary Suska wrote: > >> There have been some lengthy discussions about this. An object may choose to >> emit KVO notifications for its collection properties (but this behavior >> should never be expected unless it

Re: Question about model observers

2010-05-11 Thread Ken Thomases
On May 11, 2010, at 10:17 AM, Keary Suska wrote: > There have been some lengthy discussions about this. An object may choose to > emit KVO notifications for its collection properties (but this behavior > should never be expected unless it is specifically documented), but no > collection will ev

Re: Question about model observers

2010-05-11 Thread Keary Suska
On May 11, 2010, at 8:53 AM, Eric Giguere wrote: > Also my though, this is a job for custom accessors. > > I also guess that your answer concerning the collections don't include the > cases where you do it outside the model but in the controller layer. This has > proven to be working in other p

Re: Question about model observers

2010-05-11 Thread Eric Giguere
Hi Keary Also my though, this is a job for custom accessors. I also guess that your answer concerning the collections don't include the cases where you do it outside the model but in the controller layer. This has proven to be working in other parts of my app: [personsController addObse

Re: Question about model observers

2010-05-11 Thread Keary Suska
On May 11, 2010, at 8:10 AM, Eric Giguere wrote: > Everybody tends to point in using the KVO notifications instead of the custom > accessors, even if those are generated. Ok, but I couldn't make it work. > Using controllers, no problem but what if I want my parent entity to be its > own observe

Question about model observers

2010-05-11 Thread Eric Giguere
Hi all I have to deal here with a pretty usual situation where my entity has a to-many relationship to another entity. I need, in my parent entity, to be notified when children are added or removed since I have another attribute in my entity and its value depends on this relationship's content.