xcode - Store a ViewController in iOS -
i have 3 viewcontrollers switched swipe gesture (like carrousel). data dynamic, there anyway store viewcontroller, when swipe it, doesn't have reload data?
you dont need store, dont release them way ensure dont release them
in app delegate .h file
add property
@interface appdelegate : uiresponder <uiapplicationdelegate> { nsmutablearray *viewcontrollers; } @property (retain, nonatomic) nsmutablearray *viewcontrollers; in .m file synthesize , allocated in didfinishlaunchingwithoptions
self.viewcontrollers = [[nsmutablearray alloc] init]; now add view controllers mutable array
appdelegate *delegate = [uiapplication sharedapplication].delegate; [delegate.viewcontrollers addobject:myviewcontroller]; and when want use of view controllers have. access from
appdelegate *delegate = [uiapplication sharedapplication].delegate; myviewcontoller = [delegate.viewcontrollers objectatindex:0];
Comments
Post a Comment