7

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.

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)

Isn't it possible to add a UISwitch to a static UITableViewCell? When removing the UISwitch the error disappears.

enter image description here

Sebastian
  • 3,379
  • 2
  • 23
  • 39

3 Answers3

14

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.

enter image description here

But How come the "Accessibility" option becomes an issue of Object Id remains unclear.

newguy
  • 5,668
  • 12
  • 55
  • 95
  • 1
    You're right. When I disable the "Accessibility" option the error is gone, too. But my UISwitch isn't visible at runtime. I think the main problem is that I'm using static cells, but without a `UITableViewController`, what seems to be not possible. Do you also tried this with static cells and without a UITableViewController? – Sebastian Oct 09 '13 at 06:00
  • 1
    Yes I am using static cell on storyboard. I think I used without UITableViewController before. Now I am using UITableViewController it doesn't seem to have this problem. – newguy Oct 09 '13 at 06:23
  • 1
    I switched also to a UITableViewController and now it is working. – Sebastian Oct 09 '13 at 15:01
1

For static table cells one has use to a UITableViewController. Static cells are not supported by UITableView.

Another answering this point: https://stackoverflow.com/a/9428324/42756

Community
  • 1
  • 1
Carl
  • 2,896
  • 2
  • 32
  • 50
1

A bit late but to the game, but...

If you define a User Defined Runtime Attribute to an AutoLayout constraint that is a Placeholder (i.e. removed at build time), you get this error.

paulvs
  • 11,963
  • 3
  • 41
  • 66