Here is a list of four ways to load a line Chengyan,
1.performSelector method This method must be executed in the main thread, not blocking the current thread
[Self performselector: @selector (Delaymethod) Withobject:nil afterdelay:1.0f];
2. Timer: Nstimer, also must be loaded in the main thread, is a non-blocking execution mode
[Nstimer scheduledtimerwithtimeinterval:1.0f target:self selector: @selector (Delaymethod) Userinfo:nil Repeats:NO];
3. Sleep mode This method can be executed in both the main thread and the child thread. is a blocking method of execution that is placed in a sub-thread to avoid jamming the interface
[Nsthread sleepfortimeinterval:1.0f]; [Self delaymethod];
4.GCD mode this way in the parameters can be selected to execute the thread. is a non-blocking way of execution
< #delayInSeconds #> time to delay
Dispatch_after (Dispatch_time (Dispatch_time_now, (int64_t) (< #delayInSeconds #> * nsec_per_sec)), dispatch_get_ Main_queue (), ^{
});
IOS Delay Loading