views:

38

answers:

1

Hi

I am new iphone development. In my app, i am using two textfield and i want to save the text on the dada base which is entered in textfield then i want to display it. Here i am using CoreData base. I am feeling difficult to understand all classes on the coreData base. Here i am created view based application. What are the classes required to achieve that and is there any sample and idea?.

+2  A: 

If you just want to save two NSStrings, you should use a simpler storage method, like NSUserDefaults, instead of Core Data, which is to be used for storing larger quantities of data. You can easily save an object to NSUserDefaults by using this code:

[[NSUserDefaults standardUserDefaults] setObject:someString forKey:@"someKey"];

Then you can retrieve the saved object like this:

NSString *someString = [[NSUserDefaults standardUserDefaults] objectForKey:@"someKey"];
Douwe Maan
thanks for your answer, but here, i should be use only core data because it is required.
Sivanathan
Why are you required to use Core Data to do this? For saving just two strings, using Core Data is overkill...
Douwe Maan
Because, I want to save large number of data in future, so that i am asking coreData. but NSUserDefaults is enough as consider two textfield string.
Sivanathan