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 characters
Taken From: http://stablekernel.com/blog/speeding-up-nscoding-with-macros/ | |
#define OBJC_STRINGIFY(x) @#x | |
#define encodeObject(x) [aCoder encodeObject:x forKey:OBJC_STRINGIFY(x)] | |
#define decodeObject(x) x = [aDecoder decodeObjectForKey:OBJC_STRINGIFY(x)] | |
#define encodeFloat(x) [aCoder encodeFloat:x forKey:OBJC_STRINGIFY(x)] | |
#define decodeFloat(x) x = [aDecoder decodeFloatForKey:OBJC_STRINGIFY(x)] | |
- (id)initWithCoder:(NSCoder *)aDecoder | |
{ |
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 characters
// Doing something on the main thread | |
dispatch_queue_t myQueue = dispatch_queue_create("My Queue",NULL); | |
dispatch_async(myQueue, ^{ | |
// Perform long running process | |
dispatch_async(dispatch_get_main_queue(), ^{ | |
// Update the UI | |
}); |
OlderNewer