Proxy created by mutableArrayValueForKey: may not notify observers

Originator:jppellet
Number:rdar://15457058 Date Originated:11/13/2013
Status:OPEN Resolved:
Product:iOS SDK Product Version:7
Classification:Other Bug Reproducible:Always
 
Summary:
The array proxy obtained by calling mutableArrayValueForKey: does not always fire notifications to observers. In particular, the proxy is non-notifying if, at creation time, no observers are registered. Observers registered later are ignored by the proxy.

See also: http://stackoverflow.com/questions/19932947/in-cocoa-kvo-why-doesnt-a-change-on-a-nsmutablearray-proxy-notify-observers/19934476#19934476

Steps to Reproduce:
1. Implement on a class A the KVO mutable accessors for a to-many property
2. Call mutableArrayValueForKey: on an instance of A
3. Add an observer for the keyPath on the instance
4. Call insertObject:in<Key>AtIndex: on the instance
5. Call insertObject:atIndex on the array proxy retuned by (1)

Expected Results:
Two notifications: one sent by calling (4), one sent by calling (5)

Actual Results:
One notification, sent by calling (4). (5) does not send notifications.

Version:
7

Notes:


Configuration:
Mac OS X 10.9

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!