Pugalmuni
Pugalmuni

Reputation: 9390

How to write a query in Core Data in iPhone

I have used core data in my apps. My application works fine in online and offline mode . I have doubt about, how to write a query in Core data(Similar SQLite). I wrote a query and used in SQLite. But I want to know about, how to write a query(select, insert, update, etc,.) using core data.

Please guide me and give me some useful links.

Upvotes: 0

Views: 5007

Answers (3)

Sudipto Roy
Sudipto Roy

Reputation: 6795

You can use predicate while fetching data . For more info , visit here

Upvotes: 1

karim
karim

Reputation: 15589

I think you cannot write SQL like query (select, insert, update...), rather you have to use NSPredicate objects. Which support such type of operation in its own way.

Upvotes: 1

unholysampler
unholysampler

Reputation: 17341

You should read though Apple's tutorial on Core Data. It goes through the process of making a very simple app that used Core Data. For more complicated queries you will want to make a predicate to restrict the returned values.

Upvotes: 3

Related Questions