I’m new here but I’d like to learn very well iPhone SDK…
I’m making an iPhone app where I’d like to show a modalView controller at launch of my app… How can I do this?
In this modalView, I request some informations and the view must appear only when these informations aren’t saved!
Anyone can help me?
P.S.: Sorry for my bad English but I’m Italian… 😀 Thanks!
First, try to avoid to use NSUserDefautls as it’s not application specific and can cause troubles under some circumstances (see reference docs).
I’d suggest to save your app specific data to some plist file for which you can check for at app startup -(void) applicationDidFinishLoading: method of your app delegate class – and decide if your modal view should be shown or not.
Let’s say you have application wide accessible
NSMutableDictionary instance where you store your
preferences. When app is about to quit i.e. – (void)
applicationWillTerminate: method of your app delegate, simply store content of that dictionary to plist somewhere under you app directory structure (Documents folder is a good choice). See NSDictionary reference on how to store/read plist files. It’s pretty simple.