Yes, Objective C. has thread concepts, and there are many ways to achieve multithreading in an object C.
1> NSThread
[NSThread detachNewThreadSelector:@selector(startTheBackgroundJob) toTarget:self withObject:nil];
This will create a new thread in the background. from the main topic.
2> Using the performSelector function
[self.tableView performSelectorOnMainThread:@selector(reloadData) withObject:nil waitUntilDone:YES];
will do the user interface task in the main thread if you call it from the background thread ... You can also use
[self performSelectorInBackground:@selector(abc:) withObject:obj]
What will create the background thread.
3> Using NSoperation
Follow this link
4> Using GCD
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ [self callWebService]; dispatch_async(dispatch_get_main_queue(), ^{ [self updateUI]; }); });
Will there be a callWebService in the background thread and after it finishes. It will updateUI in the main thread. More on GCD
This is almost the entire multithreading path that is used in iOS. hope this helps.
mihir mehta
source share