-[NSArray removeObserver:fromObjectsAtIndexes:forKeyPath:context:] does not throw an exception

Originator:chaos42
Number:rdar://16461207 Date Originated:28-Mar-2014 02:21 PM
Status:Open Resolved:
Product:Documentation Product Version:2013-10-22
Classification:Other bug Reproducible:Always
 
Summary:
The documentation on -[NSArray removeObserver:fromObjectsAtIndexes:forKeyPath:context:] reads as follows: 

removeObserver:fromObjectsAtIndexes:forKeyPath:context:
Raises an exception.

- (void)removeObserver:(NSObject *)observer fromObjectsAtIndexes:(NSIndexSet *)indexes forKeyPath:(NSString *)keyPath context:(void *)context
Parameters
observer
The object to remove as an observer.
keyPath
A key-path, relative to the array, for which observer is registered to receive KVO change notifications. This value must not be nil.
context
The context passed to the notifications.
Special Considerations
NSArray objects are not observable, so this method raises an exception when invoked on an NSArray object. Instead of observing an array, observe the to-many relationship for which the array is the collection of related objects.

The summary and special considerations sections are copy-pasted from -removeObserver:forKeyPath:context.

Steps to Reproduce:
1. Open https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSArray_Class/NSArray.html#//apple_ref/occ/instm/NSArray/removeObserver:fromObjectsAtIndexes:forKeyPath:context: or NSArray class reference documentation in Xcode
2. Read. 

Expected Results:
Should say something like "Removes _anObserver_ from the key value observer notifications associated with the specified _keyPath_ and _context_ relative to the array's object's at _indexes_." The discussion section should describe what actually happens. 

Actual Results:
Says "Raises an exception." There is no discussion section, instead there is a special considerations section copied and pasted from one of the other removeObserver: methods. 

Version:
NSArray Class Reference: https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSArray_Class/NSArray.html#//apple_ref/occ/instm/NSArray/removeObserver:fromObjectsAtIndexes:forKeyPath:context:

Notes:
Note also that in the Key-Value Observing section of the Tasks section of the document, the methods are not in alphabetical order as they usually are. 

Configuration:


Attachments:

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!