ios - Unable to set Outlet Value TopViewController of NavigationController in PreapreForSegue -
my project has following scenario:
[preview view controller] --(modal)--> navigation controller --(top)--> [photo setting view controller]
in [preview view controller], have button perform modal segue (identifier="previewtosetting"), have in [preview view controller].m file define prepareforsegue method:
- (void)prepareforsegue:(uistoryboardsegue *) segue sender:(id)sender { if ([segue.identifier isequaltostring:@"previewtosetting"]) { uinavigationcontroller *unc=segue.destinationviewcontroller; photosettingviewcontroller *psvc=(photosettingviewcontroller *) unc.topviewcontroller; psvc.lblaudio.text=@"test"; } } i set breakpoint in procedure , did see above block running without error. segue perform , lead me "photo setting" scene, text of lblaudio not set "test" thought should be, knows why?
some more information:
- lblaudio uilabel outlet property in photosettingviewcontroller (uitableviewcontroller subclass) in static table cell within table section
lblaudio sycthesized , defined as
@property (strong,nonatomic)iboutlet uilabel *lblaudio;
the lblaudio iboutlet bind such if redefine text property in viewwillappear method self.lblaudio.text=@"test", label text changed "test".
as property iboutlet @ time of segue not initialized. try
create 1 property text of label nsstring *labeltext , assign value @"test" property , in viewwillappear: method assign label work
Comments
Post a Comment