I have a viewcontroller(say A). I am pushing some viewcontrollers over the first viewcontroller(A). After some tasks, I am switching back to my first view controller(A). That is, I pop to rootviewcontroller(A). But this time my viewcontroller(A) should have an alertview.
My question: Is setting a global boolean variable the right way to go in this case. I mean, I declare a global boolean variable which sets to true, only when the viewcontrollers are popped out. Is there a better way I could do this.
Sure you may use Global NSString(or BOOL) for showing the AlertView when comes to ViewController
Here in Below code i used the String variable.
Declare a NSString variable in AppDelegate.h Class
In AppDelegate.m
then in ViewController
It’ll work