I am new to Iphone development. My app consists of two storyboards one for the Ipad and other for the Iphone.Now, my problem is I have an IBOutletCollection
of UILabel
s hooked up as a property with one of the viewcontrollers in my Iphone storyboard..How am I suppose to hook up the same Ipad storyboard viewcontroller with the IBOutletCollection
of UILabel
s for the same class..?
Thanks in advance..
Just like you'd hook up any other IBOutlet
, IBOutletCollection
or IBAction
.
Your UIViewController
sub-class contains the bits which let you hook something in a storyboard to it.
@property (strong, nonatomic) IBOutletCollection(UIButton) NSArray *tabButtons;
In your storyboard, you can assign the view controller to be of a certain class, in this case it will be a your UIViewController
sub-class. Now all you have to do it drag the storyboard artifacts to your existing IBOutlet
stubs. It works.
You can do this for multiple storyboards using the same class (or multiple view controller in the same storyboard too). When you load it into memory, you specify the item in the storyboard, then the storyboard creates and instance of the view controller and hooks up all the references, so all is good.
MyViewController *myVC = [storyboard instantiateViewControllerWithIdentifier:@"foo"];