问题描述
我想创建一个带有各种选项的UIViewController,每个选项都可以通过UISwitch启用/禁用。
我正在使用Xcode 5和iOS 7部署目标。
UITableView包含静态单元格。界面是在故事板中创建的。
I would like to create a UIViewController with various options, each can be enabled/disabled with a UISwitch.I'm using Xcode 5 and iOS 7 deployment target.The UITableView contains static cells. The interface is created in a storyboard.
当我将UISwitch添加到单元格时(对于它的 contentView
)我收到此错误:
When I'm adding a UISwitch to a cell (to it's contentView
) I get this error:
Exception while running ibtool: *** setObjectForKey: object cannot be nil (key: objectID)
是否有可能将UISwitch添加到静态UITableViewCell?
删除UISwitch时,错误消失。
Isn't it possible to add a UISwitch to a static UITableViewCell? When removing the UISwitch the error disappears.
推荐答案
我今天遇到了确切的问题,我无法弄清楚是什么原因导致了我的问题,因为我在视图控制器上添加了太多项目。现在我知道它是UISwitch。
I have the exact problem today and I couldn't figure out what is causing my problem because I have added too many items on my view controller. Now I know it is the UISwitch.
但是我已经解决了这个问题。
But I have resolved the problem, nonetheless.
我禁用了辅助功能选项和构建成功。
I disabled the "Accessibility" option and the build was successful.
但是如何将辅助功能选项变成对象ID的问题仍然不清楚。
But How come the "Accessibility" option becomes an issue of Object Id remains unclear.
这篇关于静态UITableViewCell中的UISwitch会生成错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!