NSMutableData -setLength: does not document that it may invalidate -bytes/-mutableBytes

Originator:chaos42
Number:rdar://16292597 Date Originated:11-Mar-2014 01:48 PM
Status:Open Resolved:
Product:Documentation Product Version:
Classification:Crash/Hang/Data Loss Reproducible:Sometimes
 
Summary:
Calling -setLength: on an NSMutableData can invalidate pointers previously returned by -bytes or -mutableBytes if the length is increased. This is not documented anywhere.

Steps to Reproduce:
1. Open NSMutableData documentation

Expected Results:
2. -setLength: should say something like "Note: you should assume that all pointers returned from -bytes or -mutableBytes prior to sending a -setLength: message are invalidated by that message."

Actual Results:
2. No such note exists.

Version:
NSMutableData Class Reference: https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSMutableData_Class/Reference/NSMutableData.html

Notes:


Configuration:
Documentation problem always occurs. Crashes/data loss happen depending entirely on the state of the heap and the requested resize. 

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!