Sivanathan
Sivanathan

Reputation: 1213

save the text on coreData

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?.

Upvotes: 1

Views: 170

Answers (1)

Douwe Maan
Douwe Maan

Reputation: 6878

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"];

Upvotes: 2

Related Questions