From 48d02b7080cadc507b1e7897c54ce2a8cf149acf Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Wed, 4 Nov 2009 01:15:53 +0000 Subject: - Add task support to all the main interface views - Improve task support on previously supported views - Use a threaded task load for all initial table loads - Support threaded task loads for table content loads, reloads, sorts, and filters - Improve upon previous threaded task loads by minimising view updates and supporting updates of the existing data arrays where valid --- Source/SPArrayAdditions.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'Source/SPArrayAdditions.h') diff --git a/Source/SPArrayAdditions.h b/Source/SPArrayAdditions.h index 31493f22..eb11da02 100644 --- a/Source/SPArrayAdditions.h +++ b/Source/SPArrayAdditions.h @@ -27,12 +27,11 @@ 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); + CFArrayAppendValue((CFMutableArrayRef)self, anObject); +} +static inline void NSMutableArrayReplaceObject(NSArray* self, CFIndex idx, id anObject) { + CFArraySetValueAtIndex((CFMutableArrayRef)self, idx, anObject); } @interface NSArray (SPArrayAdditions) -- cgit v1.2.3