It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center
                            
                        
                    
                
                                已关闭8年。
            
                    
我正在尝试将在选项卡栏的一页上输入的内容输入到另一页...
标签栏的第1页
标签文本字段(插入一些内容)
     生成......
标签栏的第2页
嘿..........
标签栏的第3页
嘿...插入过的东西

请让我知道是否可能发生这种情况...预先感谢您!

最佳答案

对的,这是可能的。实际上,有几种方法可以做您想要的。从描述您要做什么的方式来看,我建议您查看NSNotificationCenter。基本上,当您设置视图控制器时,第二个和第三个视图控制器可以注册以接收某种通知。当文本字段的内容更改时,第一个视图控制器将“发布”通知。第二个和第三个将收到通知,然后更新其内容。

编辑:

//register for a notification.  Whenever the notification is sent, mySelector: is called on self (probably done whe thn second and third controller are loaded)
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(mySelector:) name:@"NotificationName" object:nil];

//send a notification (done when the first view controllers action is finished)
[[NSNotificationCenter defaultCenter] postNotificationName:@"NotificationName" object:obj];

关于ios - 是否可以将 Action 从标签栏的一个页面连接到另一页面? ,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/7479401/

10-10 20:36