Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Interface Builder Storyboard Compilation Failed?

New to Xcode here -- Is there a way to get more detail out of Xcode when it runs into a compile time error? The only message I get when I try to build my application is "Interface Builder Storyboard Compilation Failed". I have no idea what file it's having a problem with.

Seriously?

Nothing additional turns up under the "Build" item in the Log Navigator either.

enter image description here

like image 618
wufoo Avatar asked Dec 04 '13 21:12

wufoo


1 Answers

Thanks to wufoo I figured mine out.

I have a tableview that has five static cells. The cells have an assortment of UIImageViews, UITextFields, etc. I had created IBOutlets in the main UITableViewController .h file and connected directly to the static cells UITextfields in the storyboard. You can't do that.

Once I removed those connections it compiled fine for me.

It appears you have to connect UIWidgets (textfields, labels, imageviews, etc) in a statically created cell directly to IBOutlets in that cells .h file (NOT, as I did, to IBOutlets in the tableview .h file).

---- UPDATE ----
Ok, so my initial post was not entirely accurate. It appears you CAN connect IBOutlets from subclasses of UITableViewCell directly to the main UITableViewController .h file. You just have to make sure that you set the Table View Content field to "Static Cells". I missed that step.

Here is an image to illustrate: Screenshot Select your storyboard, in the detail pane on the left, ensure that your "Table View" is selected. In the pane on the right select your attributes inspector panel and change from "Dynamic Prototypes" to "Static Cells". Setup your static cells by dragging and dropping your components onto the storyboard, then if you want to link from your components directly to IBOutlet properties on your main ViewController .h file you can.

I discovered the issue I was having was that I set up static cells in storyboard, and then tried to recreate them again dynamically in the delegate method cellForRowAtIndexPath:. That does not work very well. If you use static cells you do not need to use any of the cell setup delegate methods.

Here is some excellent reading that also helped me out: Apple TableView Programming Guide

like image 77
digitalHound Avatar answered Nov 16 '22 01:11

digitalHound