iphone - Interface Builder won't allow connections to custom UIView class? -
using xcode 4.3.3, can't figure out how connect outlets in custom uiview class objects created in interface builder.
in 1 viewcontroller, have variety of buttons, sliders, etc i'm trying grouping views. so, within viewcontroller in ib, added 3 views. 1 view visible @ given time.
i derived custom uiview classes handle each of these 3 views. view controller instantiates each of classes. selected view(s) in ib, opened identity inspector , set class(es) custom class(es). when tried dragging connections view and/or it's constituent controls custom view's .h file ib won't add together connection.
ib allows me add together outlets/actions dragging parent view controller's .h, not custom view's .h file. thought 1 time set view's class custom class, drag outlets view's components custom class rather in view controller.
this question seems identical mine: how connect uiview outlets custom subview 2 solutions (manually adding outlets , setting view's class in ib) did not alter behavior me. here manual outlets added:
customview3.h
#import <uikit/uikit.h> @interface customview3 : uiview @property (retain) iboutlet customview3 *view3; @property (retain) iboutlet uislider *slider; @end
customview3.m
#import "customview3.h" @implementation customview3 @synthesize view3, slider; - (id)initwithframe:(cgrect)frame { self = [super initwithframe:frame]; if (self) { // initialization code } homecoming self; } @end
what missing here? else need set/check in order add together outlets custom uiview rather view controller?
note did work today, had insert/type outlets hand in derived class, drag header file ui element in storyboard, not other way around.
iphone ios ipad uiview iboutlet
No comments:
Post a Comment