开发者

UITableView / UINavigationBar Passes .tag from Child to Parent?

开发者 https://www.devze.com 2022-12-20 23:15 出处:网络
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:

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

精彩评论

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

关注公众号