Hi am new in this field.i am trying out one app. i am storing data in sqlite database. i am only using sqlite for my app when i add data into table from my app, I can see changes in my simulator but when i check my database there is no change and when i reset my simulator all my added data is gone. Please help me. i don't know what is wrong. there is no error.
When you say "reset my simulator" does that mean quit the app and restart it, or use the "Reset Content and Settings" option from the iPhone Simulator menu?
Doing the latter will erase all simulator apps' data, but doing the former should not.
How and where are you creating the database file that you intend to write to?
The correct thing to do is generally the following:
Put an empty copy of the database (probably with necessary tables created and any initial data already entered) in your app's bundle.
On app launch, check for the existence of the database file in your app's Documents directory. If it doesn't exist, copy it from the bundle to Documents. If it does exist, do nothing.
Your app should write to the copy of the database in your app's Documents directory. This means that the database in your app's bundle will (and must) stay the same, but the one in Documents will contain any new data.