If you need to know how many CPU’s are available this code will help you:
Unix & Coding
Today I got to know how to get the delegate methods of a class and when they are incoming. You only have to copy this method into your class and look at the log when the class is initialized / running.
- (BOOL)respondsToSelector:(SEL)aSelector { NSString *methodName = NSStringFromSelector(aSelector); NSLog(@"respondsToSelector: %@", methodName); return [super respondsToSelector:aSelector]; }
Dies ist die kleinste Möglichkeit in Cocoa asynchron nebenläufigen Code mittels GCD (Grand Central Dispatch) und Blocks zu erzeugen:
dispatch_async(dispatch_queue_create("com.app.task",NULL), ^{ // Do something ... });
Genauere Informationen sind hier erhältlich.