Reputation: 1745
I've searched for a few hours to try and figure out the answer, but haven't as of yet. On creating an outlet/action for an iOS app in Xcode 5:
I'm trying to create an outlet (by CTRL-dragging) from a label in Main.storyboard to ViewController.h (which I had to manually select in the Assistant Editor because only UIViewController.h shows up under "automatic")
No "outlet/connection/action" menu shows up when I drag. However, a menu does show up if I try to drag to the UIViewController.h file. (It just then tells me UIViewController.h is locked, and I can't unlock it)
I've also tried putting "ViewController.h" into the custom class part, as that seemed to work for some other askers out there.
I believe it may (?) have something to do with ViewController.h not showing up under "Automatic" in Assistant Editor. I have tried creating an outlet with a different project and that seems to work, and ViewController.h shows up under automatic.
I'd like to have posted a screenshot but I need 10 reputation. Anyway, thanks in advance for your help!
Upvotes: 2
Views: 447
Reputation: 774
Make sure that the scene you are using is under the UIViewController
class that you intend on using it with.
Here is how:
UIViewController
class of interest under Custom ClassUpvotes: 0
Reputation: 38728
You need to set the Custom Class
in the storyboard to a class that you have written that subclasses UIViewController
.
Upvotes: 1