I\'m new to iOS. After going through a lot of and documents i\'m confused .This is what I have to do.
I have several view controllers each has NSString values which I\'l
There are two options available storing and retrieving data in different view controllers.
1)NSUserDefaults is best option for storing data and accessing in any other view controllers.
The NSUserDefaults class provides convenience methods for accessing common types such as float, double, integer, Boolean. A default object must be a property list, that is, an instance of (or for collections a combination of instances of): NSData, NSString, NSNumber, NSDate, NSArray, or NSDictionary.
This is very easy and best method for storing and retrieving data.
if you want to read about NSUserDefaults, here i am sharing document.
https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSUserDefaults_Class/Reference/Reference.html
2) You would create properties when you want them to be accessible outside the class or other view controllers.
Create property in this way. @property (nonatomic, retain) NSArray *arrayData;
and then you can use this array value in other view controllers also.
Properties replace the accessor methods for objects.
using a db is better choice here. But if you want those data only dynamically then u can save it in a array and get those common data by delegates.
1-you can save common data with your app delegate interface . then you can access it from others interfaces
2-you can use NSUserDefault to store data with keys
3-create NSString object and with passing from view to another one pass data to new NSString object
You can save the data in multiple ways
The possibilities are endless. What works best for your project is what you should use.