gpt4 book ai didi

ios - 是否可以将选项卡栏的一页的操作连接到另一页?

转载 作者:行者123 更新时间:2023-11-29 04:58:31 24 4
gpt4 key购买 nike

很难说出这里问的是什么。这个问题是模棱两可的、模糊的、不完整的、过于宽泛的或修辞的,无法以目前的形式得到合理的回答。如需帮助澄清这个问题以便重新打开它,visit the help center .




10年前关闭。




我正在尝试将在标签栏的一页上输入的内容传递到另一页...例如
标签栏的第 1 页
标签- 文本字段(插入一些东西)
产生......
标签栏的第 2 页
嘿... .......
标签栏的第 3 页
嘿...曾经插入什么

请让我知道如果这样的事情是可能的......提前谢谢你!

最佳答案

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

编辑:

//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 - 是否可以将选项卡栏的一页的操作连接到另一页?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7479401/

24 4 0