8

I'm trying out the new Xcode 4.2 Beta and I'm wondering if my code is wrong or if I'm bumping in to an bug.

The new Storyboard feature is promising but extremely buggy at the moment. Right now I've created an simple project with a tableview. This tableview will be "Grouped style" containing UITextFields. The new "Prototype Cell" feature of storyboard let's you create a prototype cell in GUI that you can draw with the "Reuse identifier" in the method cellForRowAtIndexPath. When I drag in a UITextField in this "prototype cell" and draw it out, it works great!

However! When I reference this textfield to an outlet in my code I get the error: Uncategorized Compilation failed. Unable to write to path:...(Path to DerivedData)

Why is this? Is it a bug? Anyone else get this?

3
  • I can confirm referencing a UITextField in a prototype cell is not working... Xcode 4.2.1 ... humph
    – lol
    Jan 24, 2012 at 11:52
  • Tony's answer below worked for me. Maybe @ObjectiveCoder could accept it? Jul 21, 2012 at 17:26
  • Tony's answer help me realized what was wrong : I had an outlet between my cell (in the storyboard) text field and my table view class (code). The outlet was supposed to be between the cell in the storyboard and the cell class of course !
    – dvkch
    Aug 21, 2012 at 7:49

7 Answers 7

31

I've run into this problem on a couple of occasions in Xcode 4.2 (final release as well).

It's usually related to an outlet or other connection that you've set up that the compiler is upset about (for lack of a better term). The trick is determining which connection(s) that is.

You can view the detailed output of the build process in Xcode 4.2 by doing the following:

  1. Switch to the log navigator in the leftmost pane
  2. Select "Build "
  3. You should see the error(s), including your compilation failed error.
  4. You can expand the build log for that error by clicking the right most icon (looks like a list). That should expand and display the error causing the problems.
2
  • 1
    I made a wrong relation in a ViewController. By using the log, I could see that fault. Thanks.
    – Nasenbaer
    Apr 2, 2012 at 15:02
  • Thanks so much. You saved me a lot of hours of debugging.
    – iRuth
    Feb 14, 2014 at 0:51
4

If anyones still having a problem with this i found the solution is to use tags instead of outlets.

CellForRowAtIndexPath UILabel *titleLabel = (UILabel *)[cell viewWithTag:1001]; titleLabel.text = @"Name";

1
4

OK a collegue of mine showed me the connections inspector and voila, there was an old connection causing the build failure. So select the .storyboard file, open the connections inspector (the last with the arrow) and it will give you an overview of all the connetions.

1

I don't have the perfect solution to your problem but I had the same and I found a way to make it works (without linking the outlet to the TableViewController).

Just try to recreate your view from scratch and Build & Run every time you add a component.

In order add a TableViewController => Test if it shows an empty table.

Design your custom cell and link your cell's Outlets to it. (Without forgeting to change the Class of your TableViewCell) => Again test it

Then change the Class of the TableViewController to your class and now you would be able to access to your cell's outlets.

It worked for me. I hope it will for you.

1
  • I was going to post this solution myself, but you have it nailed down pretty accurately.The issue is being caused by a binding to a property in what is most likely the containing ViewController that has the UITableView. Instead, you should create the UITableViewCell class and bind to those properties as TroX has indicated.
    – Scott D
    Nov 17, 2013 at 16:03
1

I had to remove the folder for my project in ~/Library/Developer/Xcode/DerivedData/ and rebuild. You can find the name of that folder in the logs using Tony's procedure above.

EDIT: I now think this is a bug in Xcode (Version 4.2.1). It's intermittent for me. To fix it I have to rebuild, sometimes two or three times. Build/Clean doesn't seem to help.

EDIT 2: Ok, hopefully the real problem. I had two references to my storyboard in the project navigator (probably a remnant of copying/rebuilding the project). I just removed one of them (making sure to only delete the reference!). Seems likely to be the problem (Xcode compiling the same file twice simultaneously).

0
1

I got this error when I tried to put a / in the name of a storyboard ID. Check that you are using safe characters! (Doh!)

0

You should not add the title or the image or detail label to an outlet.

Why do you need an outlet anyways ?

They get modified implicitly inside the code when you implement the protocols.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.