Create NSThread in iPhone using Objective-C

1. Create a NSThread as follows.


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





2. Define the threadMethod in the code.


- (void)threadMethod {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];

/** add the code for the new thread **/

[pool release];
}

Comments

Popular posts from this blog

Integrating ZXing QR Code reader in iPhone / iOS applications

Multiple line of text in UIPickerView

Connect Samsung devices to Kies on Mac