iPhone SDK:知道何时单击选项卡栏上的选项卡?
我有一个选项卡栏,单击时会显示不同的视图。当您第一次单击选项卡时,它会调用 viewDidLoad 方法。但是,它只是第一次调用。
当用户单击返回该选项卡时是否会调用一个方法,因为 viewDidLoad 不会第二次被调用?
(当用户单击返回选项卡时,我需要执行此操作来更新 UITableView)
I have a tab bar which displays different views when clicked. When you click a tab for the first time, it calls the viewDidLoad method. But, it only calls that the first time.
Is there a method that is called when a user clicks back to that tab, since the viewDidLoad won't be called that second time?
(I need to do this to update a UITableView when the user clicks back to a tab)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
当然!
寻找此类内容时,最好的选择是查看文档,特别是查看您感兴趣的对象的委托。
http://developer.apple.com/ iphone/library/documentation/UIKit/Reference/UITabBarControllerDelegate_Protocol/Reference/Reference.html
Of course!
Your best option when looking for these sorts of things is to look in the documentation, specifically at the delegate for the object you're interested in.
http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UITabBarControllerDelegate_Protocol/Reference/Reference.html
我会在 UIViewController 中使用
- (void)viewWillAppear:(BOOL)animated
(文档)I would use
- (void)viewWillAppear:(BOOL)animated
in UIViewController (docs)