ios - How to know the viewController already visited or not? -
i've multiple view controllers in iphone application, , i'm using navigation controller starting.
my question is: when going first viewcontroller. go second viewcontroller, , go first viewcontroller. here how can know have seen first view. means want know whether visited first viewcontroller or not?
how can know this? because have 1 functionality in 1 viewcontroller in want functionality should run 1 time not again , again.
anyone can please me problem.
thanks,
there stack managed uinavigationcontroller of uiviewcontroller there in navigation controller,
as have not mentioned language tag, posting code in objective-c
nsarray *viewcontrollers = [[self navigationcontroller] viewcontrollers]; for( int i=0;i<[viewcontrollers count];i++){ id obj=[viewcontrollers objectatindex:i]; if([obj iskindofclass:[yourviewcontroller class]]){ // view controller visited user , in stack } }
Comments
Post a Comment