aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPArrayAdditions.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/SPArrayAdditions.h')
-rw-r--r--Source/SPArrayAdditions.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/Source/SPArrayAdditions.h b/Source/SPArrayAdditions.h
index 473740fc..31493f22 100644
--- a/Source/SPArrayAdditions.h
+++ b/Source/SPArrayAdditions.h
@@ -28,6 +28,13 @@ static inline id NSArrayObjectAtIndex(NSArray* self, NSUInteger i) {
return (id)CFArrayGetValueAtIndex((CFArrayRef)self, i);
}
+static inline void NSMutableArrayAddObject(NSArray* self, id anObject) {
+ typedef void (*SPMutableArrayAddObjectMethodPtr)(NSArray*, SEL, id);
+ static SPMutableArrayAddObjectMethodPtr SPNSMutableArrayAddObject;
+ if (!SPNSMutableArrayAddObject) SPNSMutableArrayAddObject = (SPMutableArrayAddObjectMethodPtr)[self methodForSelector:@selector(addObject:)];
+ SPNSMutableArrayAddObject(self, @selector(addObject:), anObject);
+}
+
@interface NSArray (SPArrayAdditions)
- (NSString *)componentsJoinedAndBacktickQuoted;