views:

136

answers:

2

Hi all~.

I was using simple UINavigationController. but If I come from sub viewController, I want to occur a some custom event.

For example, If rootViewController is AA and subviewController of AA is BB. and then enter the BB (by pushViewController).

and then, BB->AA. this time, I want to manage a event.

currently, I made it view UIBarButtonItem, but Its shape is RECT. (I want pentagon)

Is it possible?

A: 

In BB's -viewWillDisappear:, set a global flag.

Then in AA's -viewWillAppear:, check if the global flag is set. If yes, manage your event, then clear the flag.

KennyTM
I know these methods but my app not use them. Thank you anyway ^^.
oksk
A: 

Make BB become the delegate of the UINavigationController AA and BB are in. Then implement the navigationController:willShowViewController:animated: delegate method and check if the viewController passed in is AA.

Colin Barrett
hm... I'll test it. Thank you ^^.
oksk