views:

110

answers:

1

Hello,

I have created window based application. Tab bar controller as root controller and it has three tabs. One Tab has Labels and TextFiled inputs like Name, Username and Password.

I am looking to store this text filed inputs when user enters and able retrieve in other tabs.

Previously I have set key for different text fields and setobject:withkey task and able to retrive text filed values in same view Controller [[NSUserDefaults standardUserDefaults] stringForKey:key] task. Now I am looking to create database which has different objects and each objects has data values of different Text Field inputs that I can access in whole application. like DatabaseName -> Object1 -> Name, Username & Password -> Object2 -> Name, Username & Password Something like structure in Normal C so it would be easy to retrieve data.

I am looking NSUserDefaults Class and User Defaults Programming Topics in Cocoa(http://developer.apple.com/iPhone/library/documentation/Cocoa/Conceptual/UserDefaults/UserDefaults.html#//apple_ref/doc/uid/10000059-BCIDJFHD).

Also Referring Archives and Serialization Programming guide(http://developer.apple.com/iphone/library/documentation/Cocoa/Conceptual/Archiving/Archiving.html#//apple_ref/doc/uid/10000047i). Which method i need to use to create such type of database ?

Thanks,

A: 

If you're just saving a small array of a limited size, then using NSUserDefaults like this is probably ok.

If it's truly a "database" that may contain a large number of objects and/or change frequently, most people would probably recommend that you use Core Data instead.

cduhn
Hello cduhn,I am not looking for large database but around 15 to 20 objects with few data fields. Here, I want to access stored data from another tab bar view of application and able to retrieve when Application start.Which way I need to proceed ?Thanks,
TechFusion
I think if you already knew how to use both techniques you would choose Core Data, but either technique should work.
cduhn
Thanks, cduhn,I have referred few application like DrillDownSave, AppRef of iPhone OS Sample Code. That application is using Setting.Bundle with .plist to store application settings.Does it is require to use .plist for storing data? I am looking to make Disctoinary of objectswithKeys and make array of Disctionary so I can make like structure of C and Array of Structure object.I gone through NSUserDefault Class Reference and NSDictionary Class Reference also but I got stuck about how to proceed ? Should I need to use setting.Bundle or what else?Thanks,
TechFusion