Ravi Kiran
Ravi Kiran

Reputation: 671

can we directly access the SQLite data base of core data

In an iphone application i am using core data to manage all my data, now my question is can we directly access the data base which has created by core data using our own queries? is it possible ? if so, will apple approve the app ? is it against the apple guidelines ?

Upvotes: 0

Views: 958

Answers (2)

Manuel Binna
Manuel Binna

Reputation: 1245

The Core Data Programming Guide states that you should not access the SQLite file manually:

"Although Core Data supports SQLite as one of its persistent store types, the database format is private. You cannot create a SQLite database using native SQLite API and use it directly with Core Data (nor should you manipulate an existing Core Data SQLite store using native SQLite API)."

Upvotes: 3

Stephen Darlington
Stephen Darlington

Reputation: 52565

Can we directly access the data base which has created by core data using our own queries?

Yes.

is it possible ?

Yes.

if so, will apple approve the app ?

Yes.

is it against the apple guidelines ?

No.

Unfortunately, the question you're not asking is the most important:

should we directly access the SQLite database of Core Data

No.

The format is not public and could change. You don't know when it is accessed or what problems could be caused by messing around with it behind Core Data's back.

Upvotes: 11

Related Questions