NSArray is missing the firstObject method

Originator:cedric.luthi
Number:rdar://7352369 Date Originated:30-Oct-2009 06:46 PM
Status:Duplicate/3058939 Resolved:
Product:Other Product Version:Cocoa API
Classification:Enhancement Reproducible:Not Applicable
 
Summary: 
NSArray is missing the firstObject method.

Steps to Reproduce:
[anArray firstObject];

Expected Results:
NSArray provides the firstObject method.

Actual Results:
NSArray does not provide the firstObject method.

Regression:
Since Mac OS X 10.0

Notes:
NSArray provides the lastObject method. It doesn't make sense to have a lastObject method without its firstObject method counterpart.

NSMutableArray is also missing removeFirstObject but provides removeLastObject.

The Automator framework provides the firstObject method in NSArray's AMCocoaExtensions category, but I'd prefer not relying on this.

Comments

Duped as 12322471

By heath.borders at Sept. 18, 2012, 7:42 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!