2. Multithreaded ①nsthread②nsoperation③gcd (Grand Central Dispatch)
• Do not create a queue of your own system
-Dispatch_get_global_queue (dispatch_queue_proirity_DEFAULT, 0) Replace: High,low
-Dispatch_get_main_queue
• wait for a set of threads to end before performing an action
Dispatch_group_async (group, queue, block^{
.......
Dispatch_group_notify (Group, Dispatch_get_main_queue (), ^{
Finished;
});
});
group:dispatch_group_t group = dispatch_group_create;
queue:dispatch_queue_t queue = Dispatch_get_global_queue (Dispatch_queue_priority_default, 0);
•1 ends before execution 2,2 ends to execute 3
Dispatch_async (queue,block^{
Dispatch_async (queue,block^{});
Dispatch_barrier_async (queue, block^{});
Dispatch_async (queue,^{});
});
queue:dispatch_queue_t queue = dispatch_queue_create ("note", dispatch_queue_concurrent);
1.NSAarry
• How to delete weight
Nsarray *a;
Nsset *unique = [Nsset setwitharray:a];
Nsarray *b = [[Nsarray alloc] Initwitharray:[unique allobjects]];
IOS Face Test Summary