Apple Interview Question

Is there a difference between performSelector and performSelector:withDelay of 0?

Interview Answers

Anonymous

Jan 26, 2016

Calling performSelector will call that function synchronously. Calling performSelector:withDelay: of 0 will perform that function on the next run loop.

2

Anonymous

Jul 26, 2015

Yes. The difference is when the selector is executed. performSelector executes the selector immediately whereas performSelector:withDelay of 0 does not, as you can see from apple's documentation: "Specifying a delay of 0 does not necessarily cause the selector to be performed immediately."