problems creating outlets in header files through dragging

Discussion in 'iOS Programming' started by blue-lion, May 13, 2013.

  1. blue-lion macrumors member

    Joined:
    Jan 26, 2010
    #1
    Hi, probably a common problem but..... i cant create outlets in the header file by control dragging. I have the storyboard and the header file on the screen at the same time, and the blue elastic line appears but when i drag it over the header file , nothing happens???

    Any one know the most obvious thing to look for??
     
  2. Duncan C macrumors 6502a

    Duncan C

    Joined:
    Jan 21, 2008
    Location:
    Northern Virginia
    #2
    You have to drag into the header file between the @interface and the @end of your view controller.

    IF you want to create an outlet instance variable, drag inside curly braces in the interface.

    If you want to create outlet properties or actions, drag outside the curly braces. Note that if you use all properties and no instance variables, you might not even have curly braces inside your interface.

    You can also drag into your .m file to create actions and outlets there that don't have entries in your header file.

    Code:
    @inteface myVC: UIViewController
    {
    //Drag here to create IBOutlet iVars
    }
    
    //Drag here to create IBOutlet properties or actions
    
    @end
     

Share This Page