please refer following code.in have 1 property
@property (nonatomic,strong) customview *promptview;
and getter method loading using xib.
- (customview *)promptview { if (!_promptview) { _promptview = [[[nsbundle mainbundle] loadnibnamed:@"customviewxib" owner:self options:nil] objectatindex:0]; [_promptview.buttoncheckmark addtarget:self action:@selector(btnclick:) forcontrolevents:uicontroleventtouchupinside]; _promptview.alertmessage.text = @"hello text"; _promptview.frame = cgrectmake(0, 0, screen_width, screen_height); } return _promptview; }
but getting nil value alertmessage
which iboutlet , declared , connected customview.h as
@property (weak, nonatomic) iboutlet uilabel *alertmessage;
also tried set file owner customview. getting uiview object (promptview) properties nil. how resolve this?
tried following solutions
Comments
Post a Comment