如果我删除表视图中的一行,模拟器将恢复到主屏幕

发布于 2024-10-04 20:01:38 字数 115 浏览 0 评论 0原文

我正在使用显示(例如 16)行随机数据的表视图。如果我删除一行,模拟器将恢复到主屏幕。如果我触摸重新加载,我将再次获得 16 行不同的随机数据。如果我滚动屏幕,也会出现同样的行为。

有人有什么想法吗?

I am using a table view displaying (say 16) rows of random data. If I delete a row, the simulator reverts to the home screen. If I touch to reload, I again have 16 rows of DIFFERENT random data. Same behavior if I scroll the screen.

Does anyone have any ideas?

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

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

发布评论

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

评论(1

深海夜未眠 2024-10-11 20:01:38

恢复到主屏幕意味着您的应用程序已崩溃。从 XCode 调试器运行应用程序以帮助找出位置。

UITableView 是 MVC 的视图,而不是模型。如果您没有将随机数据存储在模型对象中的某个位置,则当视图刷新并再次请求数据时,将无法重新显示完全相同的数据。

A revert to the home screen means your app has crashed. Run the app from the XCode Debugger to help find out where.

A UITableView is the View of MVC, not the Model. If you didn't store your random data in a Model object somewhere, the exact same data can't be redisplayed when the View refreshes and asks for data again.

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