ios - performSelector:afterDelay versus NSTimer:ScheduleTimerWithTimeInterval -


i have method execute (non repeating) after time delay.

i use performselector:afterdelay or schedule nstimer , specify selector parameter that.

what advantages / disadvantages of using 1 on other if end result same (which method called after specified time delay). not matter 1 use?

(in case relevant, method called both in foreground , when app moves background during 10 minute window available via beginbackgroundtaskwithecpirationhandler).

tia

from apple reference of nsobject class performselector: method

this method sets timer perform aselector message on current thread’s run loop. timer configured run in default mode (nsdefaultrunloopmode). when timer fires, thread attempts dequeue message run loop , perform selector. succeeds if run loop running , in default mode; otherwise, timer waits until run loop in default mode.

so if want make single call, think can freely use performselector:afterdelay:


Comments

Popular posts from this blog

jquery - Invalid Assignment Left-Hand Side -

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -