• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Mutable to-many relationship not observable
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mutable to-many relationship not observable


  • Subject: Re: Mutable to-many relationship not observable
  • From: Remco Poelstra <email@hidden>
  • Date: Fri, 14 Jan 2011 12:23:55 +0100

Hi,

I add the observer as follows:
	[[DigiDevicesManager sharedDigiDevicesManager] addObserver:self forKeyPath:@"digiDevices" options:NSKeyValueObservingOptionOld context:nil];
It's superclass is NSObject and I did not disable automatic notifications.

If mutate the array (from inside the observed object) with [self {will/did}change..] then everything works fine.

Regards,

Remco Poelstra

Op 14 jan 2011, om 12:11 heeft Mike Abdullah het volgende geschreven:

> Show us your code that adds the observer. Also, what is the superclass of this class?
>
> On 14 Jan 2011, at 10:45, Remco Poelstra wrote:
>
>> Hi,
>>
>> I've a property digiDevices that's a to-many relationship. I've implemented the value write accesors (in addition to the read ones, which behave perfect):
>> - (void) insertObject:(DigiDevice *)digiDevice inDigiDevicesAtIndex:(NSUInteger)index {
>> 	[digiDevices insertObject:digiDevice atIndex:index];
>> }
>>
>> - (void) removeObjectFromDigiDevicesAtIndex:(NSUInteger)index {
>> 	[digiDevices removeObjectAtIndex:index];
>> }
>>
>> When I modify the relationship through mutableArrayValueForKey: the object is correctly removed, but no notification is send to objects observing the array. The KVC Guide states that I get automatic KVO by implementing these methods.
>> Is there something I did wrong?
>>
>> Kind regards,
>>
>> Remco Poelstra
>>
>> _______________________________________________
>>
>> 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

  • Follow-Ups:
    • Re: Mutable to-many relationship not observable
      • From: Ken Thomases <email@hidden>
References: 
 >Mutable to-many relationship not observable (From: Remco Poelstra <email@hidden>)
 >Re: Mutable to-many relationship not observable (From: Mike Abdullah <email@hidden>)

  • Prev by Date: Re: Determining whether a dictionary is mutable or not
  • Next by Date: Re: Determining whether a dictionary is mutable or not
  • Previous by thread: Re: Mutable to-many relationship not observable
  • Next by thread: Re: Mutable to-many relationship not observable
  • Index(es):
    • Date
    • Thread