nyi
nyi

Reputation: 1657

Does [NSInvocation invoke] block execution until done?

If I call invoke on NSInvocation, is it the same as calling performSelector: with the argument waitUntilDone:YES? That is, does invoke block the execution until the called selector is done?

In other words, are the two following code lines exactly the same?

// myInvocation is of type NSInvocation
[myInvocation invoke];
[myInvocation performSelectorOnMainThread:@selector(invoke) withObject:nil waitUntilDone:YES];

Upvotes: 0

Views: 203

Answers (1)

gnasher729
gnasher729

Reputation: 52612

[NSInvocation invoke] is exactly the same as calling the message that the NSInvocation represents. Like any message call, it will do it on the current thread.

Upvotes: 3

Related Questions