diff options
Diffstat (limited to 'Source/SPArrayAdditions.h')
-rw-r--r-- | Source/SPArrayAdditions.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Source/SPArrayAdditions.h b/Source/SPArrayAdditions.h index 7a672dc0..044699db 100644 --- a/Source/SPArrayAdditions.h +++ b/Source/SPArrayAdditions.h @@ -24,6 +24,15 @@ #import <Cocoa/Cocoa.h> +static inline id NSArrayObjectAtIndex(NSArray* self, NSUInteger i) { + typedef id (*SPArrayObjectAtIndexMethodPtr)(NSArray*, SEL, NSUInteger); + static SPArrayObjectAtIndexMethodPtr SPNSArrayObjectAtIndex; + if (!SPNSArrayObjectAtIndex) SPNSArrayObjectAtIndex = (SPArrayObjectAtIndexMethodPtr)[self methodForSelector:@selector(objectAtIndex:)]; + id to_return = SPNSArrayObjectAtIndex(self, @selector(objectAtIndex:), i); + return to_return; +} + + @interface NSArray (SPArrayAdditions) - (NSString *)componentsJoinedAndBacktickQuoted; |