1. In IOS programming, there are several situations where multithreading is required: UI events must be performed on the mainline thread, others can be performed in the background, and tasks that are time-consuming or blocking threads are finally placed in the background line thread.
There are several multithreading techniques for 2.iOS: threads, GCD, and Nsoperationqueue (Operation Queues).
3. Threading this technique is more complex, but the thread has a later advantage: the ability to accurately guarantee the time of task execution. GCD full name is the Grand Central Dispatch, is libdispatch the external code of this library, based on the bottom of C to implement, and Nsoperationqueue, commonly known as the Operation queue, is based on GCD implementation. GCD can do nsoperationqueue basically can do, and there are some GCD features that are not easy to implement, such as suspend, cancel the task, although in IOS 8, GCD also provides the ability to cancel the task, but in the GCD of the task hangs and cancellations have a greater limitation; though most of the cases Should use a higher level of abstraction API, that is, nsoperationqueue, but to handle the general background tasks I prefer GCD, mainly GCD collocation blcok easy to use, very convenient.
Multithread when to deal with multi-threading, there are several ways, pros and cons?