ios - How to make a connection to UIContainerView -
i have standard extended uiviewcontroller (called parentviewcontroller, or pvc), , want have container or kid view driven childviewcontroller or cvc.
i see programmatically, in pvc can phone call addchild:cvc , manage calls such didmovetoparentviewcontroller, etc.... however, hoping there way interface builder.
so laid out instance of pvc, dragged containerview onto pvc's view creates segue kid window. in window assigned class type of childviewcontroller. looks great far, how reference programmatically pvc? let's seek usual: in pvc class extension, have declared:
@property (nonatomic, strong) iboutlet childviewcontroller* cvc;
when switch ib, , highlight pvc instance, , select connections inspector, see cvc property cannot hook containerview instance (even though class type set appropriately). allows me drag (draw line), not allow me hook up. why??
i thinking isn't possible ib, perhaps i'm looking @ incorrectly?
i have read apple's docs on kid views , prepared programmatically if can't ib i'm intending.
cvc kid view controller of pvc, can reference childviewcontrollers property, in code rather hooking outlet in ib. in pvc's viewdidload method, this:
self.cvc = (childviewcontroller *)self.childviewcontrollers[0];
xcode not allow hook outlets between 2 different controllers, though cvc embedded kid view controller, it's still different view controller.
ios ipad
No comments:
Post a Comment