Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Xcode array Help

Options
  • 09-07-2014 9:51pm
    #1
    Registered Users Posts: 263 ✭✭


    Hi People, New To IOS Development, Just wondering if you can make an array In the IBOutlet inside the interface of the header file

    For example instead of

    IBOutlet UIButton *Letter1;
    IBOutlet UIButton *Letter2;
    IBOutlet UIButton *Letter3;
    IBOutlet UIButton *Letter4;
    IBOutlet UIButton *Letter5;
    IBOutlet UIButton *Letter6;
    IBOutlet UIButton *Letter7;

    Have something like IBOutlet UIButton *Letter[7];

    Been trying a few different ways and can't seem to find a simple answer?

    Any help is much appreciated

    Dpjmie


Comments

  • Closed Accounts Posts: 3,780 ✭✭✭Frank Lee Midere


    dpjmie wrote: »
    Hi People, New To IOS Development, Just wondering if you can make an array In the IBOutlet inside the interface of the header file

    For example instead of

    IBOutlet UIButton *Letter1;
    IBOutlet UIButton *Letter2;
    IBOutlet UIButton *Letter3;
    IBOutlet UIButton *Letter4;
    IBOutlet UIButton *Letter5;
    IBOutlet UIButton *Letter6;
    IBOutlet UIButton *Letter7;

    Have something like IBOutlet UIButton *Letter[7];

    Been trying a few different ways and can't seem to find a simple answer?

    Any help is much appreciated

    Dpjmie

    No. Those outlets are designed to allow you to connect in the xib or storyboard. So they have to be seperate at nib instantiation.


  • Registered Users Posts: 263 ✭✭dpjmie


    Cheers Frank, Much Appreciated


  • Registered Users Posts: 1,176 ✭✭✭vinnycoyne


    Take a look at the IBOutletCollection section over at http://nshipster.com/ibaction-iboutlet-iboutletcollection/


Advertisement