Search code examples
iosobjective-cxcodexcode6xcode6.1

IBOutlets not showing on XCode 6.1 (6A1052d)


This is quite a major problem: the Outlets are not appearing in IB.

To reproduce:

1) I declare a variable to be IBOutlet, for example in my view controller's .h file

@property (nonatomic, strong) IBOutlet UILabel* testlabel;

2) I open the storyboard, click on the viewcontroller. - If this is a new project, there is no "Outlets" list. - If this is an old project with outlets already defined, the "Outlets" list contains the previous outlets, but not the one I've added.

Has anyone had the same problem. This is really important, as I can't basically proceed unless I stop using Outlets. I can't find any info about it on the release notes.

EDIT I'm adding a video on youtube showing the problem, in case I haven't explained it properly. If I'm forgetting something obvious, I'm happy to be laughed at :) That said, I've always been following these same actions and Outlets have always been in the list.

EDIT 2 For clarity, I've removed the ivar declaration as it seemed to get most of the attention.

Outlets on Youtube

EDIT 3 Ok I seem to be hitting a problem seen previously on this question and this other question. Basically, if I open the custom class drop-down, I see only some "standard" classes, such as UIViewController. If I select any of these, I get the Outlets. For example, for UIViewController I always have that view->View. However, my project's classes are not in the drop-down. Entering the name manually seems to work, but in fact it's not. There must be some indexing issue (except I've already deleted everything from

~/Library/Developer/Xcode/DerivedData/

without success. If you wish to try, I've put my code on GitHub. This doesn't show the Outlets for me, but it does for a number of other people - so it's not a "bug" with the code strictly speaking. It's more an XCode issue. Any help would be welcome!

EDIT 4 I think here's the problem, pretty much: look on the right. The drop-down menu doesn't show the "ViewController.h" class. If I enter it manually, it seems to recognise it but in fact I suspect it doesn't. In previous times, I was always seeing the full list of my project's classes in the drop-down menu. Class list is just generic


Solution

  • I've found a "solution", or workaround. Deleting the XCode data is not enough, and it's not enough to just restart it. The following sequence makes the Outlets magically re-appear and work properly:

    1. Clean project
    2. Close XCode
    3. Delete all contents of ~/Library/Developer/Xcode/DerivedData/
    4. Restart MacOs

    By doing this, when you re-open XCode and it reindexes, it will show the outlets as expected.