Thursday, June 30, 2011

Simple NSThread Example


Threading

Sample Format:
Step .1
[NSThread detachNewThreadSelector:@selector(myMethod) toTarget:self withObject:nil];

Step .2
- (void)myMethod { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];

*** code that should be run in the new thread goes here ***


[pool release]; }

Step .3
[self performSelectorOnMainThread:@selector(myMethod) withObject:nil waitUntilDone:false];

No comments:

Swift Operators - Basic Part 3 (Range operators in swift)

Range Operators: Closed Range operators  Half-Open Range Operators One-Sided Ranges Closed Range Operators:  a...b It defines...