Conflicting Documentation: Many NSBundle instance method should return an optional type-specific arrays (Swift)

Originator:arthur
Number:rdar://20818233 Date Originated:May 5, 2015
Status:Open Resolved:No
Product:iOS SDK Product Version:iOS 8.3
Classification:Other Bug Reproducible:Always
 
The Swift documentation is conflicting for many NSBundle methods that return [AnyObject]? and [AnyObject].

The declaration for the following methods states that it returns [AnyObject]?, however, the discussion/returns section states that [NSString]?, [NSURL]?, or [NSURL] should be returned. 

The attached screenshot is for the contentsOfDirectoryAtPath(path:, error:) method, however, this issue is visible in:

- contentsOfDirectoryAtPath(path:, error:)
- subpathsOfDirectoryAtPath(path:, error:)
- componentsToDisplayForPath(path:)
- subpathsAtPath(path:)
- mountedVolumeURLsIncludingResourceValuesForKeys(propertyKeys: options:)
- contentsOfDirectoryAtURL(url:, keys:, mask:, error:)
- URLsForDirectory(directory:, domainMask:)

Steps to Reproduce:
Look at the documentation for:

- contentsOfDirectoryAtPath(path:, error:)
- subpathsOfDirectoryAtPath(path:, error:)
- componentsToDisplayForPath(path:)
- subpathsAtPath(path:)
- mountedVolumeURLsIncludingResourceValuesForKeys(propertyKeys: options:)
- contentsOfDirectoryAtURL(url:, keys:, mask:, error:)
- URLsForDirectory(directory:, domainMask:)

Comments

Fixed and closed as of January 6, 2016.


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!