Hi I have Just Update my xcode to xcode5, but I have no idea how to add new referencing outlet using xcode 5 by ctrl-drag and drop the label or buttons just like previous what I did in xcode 4.5
Thank you in advance
Hi I have Just Update my xcode to xcode5, but I have no idea how to add new referencing outlet using xcode 5 by ctrl-drag and drop the label or buttons just like previous what I did in xcode 4.5
Thank you in advance
Open your storyboard and click on the editor button (seems like a suit) and select the .h associate to your view :
Then, ctrl drag the UI element from the storyboard or xib on your header file or your .m between @interface and @end.
XCode will show you a pop-up with some options :
And you will obtain the following code :
@interface ViewController : UIViewController
@property (weak, nonatomic) IBOutlet UIScrollView *myScrollView;
@end
Today, I also encountered this problem. And I resolved it like this:
Start by selecting the ViewController you want the outlet in your storyboard.
Then click on the suite symbol on the upper right and make sure the storyboard is on the left and the header of the custom UIViewController is on the right, you can click on automatic on top of the right file to get some help with this.
Then ctrl drag the label from the storyboard on the left between @interface and @end in the header on the right.
I was missing the obvious myself here. To add a new Referencing Outlet (I'm using XCode 9.0) I did the following:
New Referencing Outlet
to the line in your header file where you want the new variable reference.