如果我删除表视图中的一行,模拟器将恢复到主屏幕
我正在使用显示(例如 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
恢复到主屏幕意味着您的应用程序已崩溃。从 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.