IOS Run method in background

[NSThread detachNewThreadSelector:@selector(doSomethingInBack:) toTarget:self withObject:nil];


-(void) doSomethingInBack:(id)anObject {
NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init];

//place code you want to run in different thread HERE

[NSThread exit];
//we need to do this to prevent memory leaks
[autoreleasepool release];
}

Comments

Popular posts from this blog

Java : Variables Declaring

Install DNF in RHEL/CentOS 7

SQL Self JOIN