I cautioned here: the specific case that you are describing should probably not be done that way. This is almost certainly too clever and should probably be divided into viewDidLoadand viewWillAppearnot two versions viewWillAppear. However, a problem arose.
My preferred solution for this is to save SEL, which indicates what I want to do. For example, I use this technique for the “next step” after complex asynchronous activity:
if (self.nextActionSelector != NULL)
{
[self performSelector:self.nextActionSelector];
}
, viewWillAppearSelector, , viewWillAppear , .
Ben Method Method Swizzling , , - , . ... , . . .
, -forwardInvocation:, , . , , . , , . . , , , , .
, , , . , view - , , , , (, iPhone , ). , , , , - . , , NSInvocation - (, , , 500 , . , , ).