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

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -