ios - viewDidLoad() method not called after simultaneous pop and push to same view -
i using code navigation view controller in start
self.window = [[uiwindow alloc] initwithframe:[[uiscreen mainscreen] bounds]]; splashviewcontroller *rootvc = [[splashviewcontroller alloc]initwithnibname:@"splashviewcontroller" bundle:nil]; self.navigator = [[uinavigationcontroller alloc] initwithrootviewcontroller:rootvc]; self.window.rootviewcontroller = self.navigator; [self.window makekeyandvisible];
after using simple method push next view
scoreboardlistviewcontroller *slvc = [[scoreboardlistviewcontroller alloc]initwithnibname:@"scoreboardlistviewcontroller" bundle:nil]; [self.navigationcontroller pushviewcontroller:slvc animated:yes];
and using pop out view
[self.navigationcontroller popviewcontrolleranimated:yes];
but when poppet , again push same view different property values viewdidload method did not run
it runs if other view , push view
i not able understand abnormal behaviour. when ever push view viewdidload should executed.....
for example doing view ->
slvc.trigger = @"sold"; slvc.lblheader.text = value; [self.navigationcontroller pushviewcontroller:slvc animated:yes];
-> popped out button using this
[self.navigationcontroller popviewcontrolleranimated:yes];
-> push same view different property
slvc.trigger = @"earning"; slvc.lblheader.text = value; [self.navigationcontroller pushviewcontroller:slvc animated:yes]
and time viewdidload didn't run.
this because holding strong pointer slvc controller. when pop it, view controller retained. initializing new controller every time push solve problem.
Comments
Post a Comment