Created
March 6, 2010 22:26
-
-
Save alexrozanski/323983 to your computer and use it in GitHub Desktop.
Revisions
-
Perspx created this gist
Mar 6, 2010 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,4 @@ @interface NSArray (PXArrayAdditions) - (id)initWithObject:(id)object; - (id)firstObject; @end This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ @implementation NSArray (PXArrayAdditions) - (id)initWithObject:(id)object { return [self initWithObjects:object,nil]; } //Follows -lastObject in that returns nil if no objects present - (id)firstObject { if([self count]>0) { return [self objectAtIndex:0]; } else { return nil; } } @end