开发者

UITableView / UINavigationBar Passes .tag from Child to Parent?

I am setting a tag for my navigationBar using:

self.navigationController.navigationBar.tag = 1;

When you select a cell and the child UITableView loads, I set:

self.navigationContr开发者_JAVA百科oller.navigationBar.tag = 2;

But when I hit the 'back' button and the Parent UITableView appears again, the .tag is still set to 2.

I have tried setting tag=1 in the Parent's viewDidLoad, viewWillAppear, viewDidAppear and in the Child's viewWillDisappear - any help would be greatly appreciated.


As a rule of thumb, only use .tag properties on non-system UIView classes. You might be better off mapping these navbars in an NSMutableArray.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜