故事板转场推送以及 plist 覆盖

发布于 2024-12-22 00:40:28 字数 247 浏览 3 评论 0原文

我使用故事板segue从一个视图“控制器A”推送到带有“按钮”的视图“控制器B”。 同时,“button”调用 [self writeToPlist] 将 plist 上的“value 1”覆盖为“value 2”。 之后,“视图控制器 B”将显示 plist 中的“值 2”。

问题是 plist 似乎在“视图控制器 B”加载后被覆盖。 所以“视图控制器 B”将只显示“值 1”, 之后写的是“值2”。

我该如何解决它,我不知道应该如何解决。谢谢

I was using storyboard segue to push from one view "controller A" to view "controller B" with a "button".
at the same, "button" call [self writeToPlist] to overwrite "value 1" to "value 2" on a plist.
after that,"view controller B" will display the "value 2" from plist.

the problem is it seems like the plist was overwritten AFTER "view controller B" loaded.
so "view controller B" will just display the "value 1",
"value 2" was written after that.

how can i solve it,i have no idea how it should be.thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

被翻牌 2024-12-29 00:40:28

如果您将按钮连接到代码中的 IBAction 方法,执行文件更改,然后调用 PerformSegueWithIdentifier: 方法来强制转换,应该没问题。

If you wire your button to an IBAction method in code, perform the file change, then call performSegueWithIdentifier: method to force the transition, it should be fine.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文