0

I've created a UITableViewController in Xcode storyboard first (with a UITableView on it obviously) but since I want also a UIButton and segmented control on the same page I replaced the view with a UIViewController and UIView and then put a UITableView on it and moved my already defined (static) table cells into it.

However when trying to compile I get the error:

.../iPhone.storyboard: Exception while running ibtool: *** setObjectForKey: object cannot be nil (key: objectID)

Does anyone know what is wrong here?

arne
  • 4,514
  • 1
  • 28
  • 47
BadmintonCat
  • 9,416
  • 14
  • 78
  • 129
  • I think your data source may be nil... That is there is no data in some index...Can you put your tableview creation code – Seeker Dec 06 '13 at 09:40
  • check for datasoure & delegates are set. If set are the really called? – Jay Gajjar Dec 06 '13 at 09:41
  • This did the trick for me: http://stackoverflow.com/questions/19730440/how-to-setup-a-static-uitableview-as-a-subview-of-uiview – BadmintonCat Dec 06 '13 at 10:09

3 Answers3

0

You can only use static cells with an UITableViewController.

iCode
  • 1,456
  • 1
  • 15
  • 26
0

static cells can only be used with UITableViewController. disable the "Accessibility" option and try building again. refer this UISwitch in static UITableViewCell generates error for more info

Community
  • 1
  • 1
Suhit Patil
  • 11,748
  • 3
  • 50
  • 60
  • Where do I disable the Accessibility for the tableview? And more importantly: Is surely is possible to define a custom controller class for the UIView-embedded tableview, is it? – BadmintonCat Dec 06 '13 at 09:49
  • I see Accessibility is in the Identity inspector. Well, the UITableView shows no such option and for the UIView and table cells they are already disabled. – BadmintonCat Dec 06 '13 at 09:55
  • I think what In need is this one here: http://stackoverflow.com/questions/19730440/how-to-setup-a-static-uitableview-as-a-subview-of-uiview – BadmintonCat Dec 06 '13 at 10:03
  • please ignore the Accessibility option, i think it was for uiswitch. Try using UITableViewController for static cells, Take a viewController and add tableviewcontroller inside another view in that viewcontroller. – Suhit Patil Dec 06 '13 at 10:12
  • Yep, see my former comment. That was the solution after all. Use a container to embed a tableview controller so that table can use a controller. – BadmintonCat Dec 06 '13 at 10:28
0

It would be helpful if you could put some code samples to see what's happening, because theoretically speaking you did everything right !!

You must've forgot some variable or something, something is nil. Checkout your wiring between the Storyboard and ViewController.m, that might be a problem.

Nour Helmi
  • 705
  • 1
  • 6
  • 17