NSPropertyListSerialization documentation inconsistency

Number:rdar://5563963 Date Originated:28-Oct-2007 02:19 PM
Status:Closed Resolved:
Product:Documentation Product Version:
Classification:Other Bug Reproducible:
28-Oct-2007 02:19 AM Jens Ayton:
The Mac OS X Developer Release Note says:

NSPropertyListSerialization leak fix
In apps linked on 10.5 and later, a leak has been fixed in the NSPropertyListSerialization methods:
+ (NSData *)dataFromPropertyList:(id)plist
                errorDescription:(NSString **)errorString;
+ (id)propertyListFromData:(NSData *)data
                    format:(NSPropertyListFormat *)format
          errorDescription:(NSString **)errorString;
In all prior Mac OS X releases, the errorString, when filled in with an error string upon error, was not being autoreleased as it should have been. Now it is. Anyone working around the leak by explicitly releasing the out string (upon error, of course) should stop doing their workaround when linking against 10.5 or later and running on 10.5 or later.

However, the documentation for these methods still says:
Upon return, if the conversion is successful, errorString is nil. If the conversion fails, upon return contains a string describing the nature of the error. If you receive a string, you must release it.

The documentation should be updated to state that this issue existed when linking against 10.4 and earlier.

11-Jan-2008 03:16 AM Jens Ayton:
Halfway there. The documentation for +dataFromPropertyList:format:errorDescription: has been corrected. The documentation for +propertyListFromData:mutabilityOption:format:errorDescription: has not.

26-Apr-2009 11:49 AM Jens Ayton:
The now-incorrect information is once again in place for both methods in the current Leopard SDK documentation, as well as the iPhone SDK documentation.


The documentation is correct

The release note quoted above is outdated. The new release notes say:

""" NSPropertyListSerialization (Updated since WWDC 2007)

A previous release note in the Leopard Foundation release notes said that a leak has been fixed in the two NSPropertyListSerialization methods that return an NSString * error description by reference. This fix has been reverted, and will never be done. As stated in the documentation for those methods, and as was true in 10.4 and earlier, it is the client's responsibility to release that string (if either method returns nil) in 10.5 and beyond as well. """


Hmm, so I see. It’s a bit sneaky of them to say “Updated since WWDC 2007” when the incorrect information was actually there after Leopard final was released, though.

By jens.ayton at July 4, 2009, 5:09 p.m. (reply...)

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!