Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个导航项,当您单击该导航项上的按钮时,导航控制器将弹出。这很好,但我想在弹出之前向层次结构中此项目上方的导航项目发送消息。
有没有办法做到这一点?
谢谢
您无法轻易找出即将显示的视图控制器,并向其发送消息。
然而,系统在显示之前已经向视图控制器发送了一条消息。该- (void)viewWillAppear:(BOOL)animated消息将在视图出现之前发送,这包括在单击导航返回按钮之后,就在视图显示之前。
- (void)viewWillAppear:(BOOL)animated
这通常应该是你想要的。你这里还有其他要求吗?