I am working on thread in Iphone. Can anyone explain the difference between
[NSThread detachNewThreadSelector:@selector(loadButtonInfo:) toTarget:self withObject:buttonInfo];
and
[self performSelectorOnMainThread:@selector(loadButtonInfo:) withObject:buttonInfo waitUntilDone:NO];
The first method creates a new (background) thread and runs the specified method.
The second calls the specified method on the main thread. This is important because the main thread is the only thread in which you should manipulate the user interface. So, if you update the data in your model in a background thread, for example, you might then want to execute a method in the main thread to update the display to reflect the new data.