开发者

Questions on Index of Entity in Core Data

1) Does clicking index property of an entity automatically creates index of that property as the data is 开发者_如何学编程entered and its not required to enter the index ??

2) If an entry is removed from the middle, for example with index no 3 .. then will the new indices will be 0 1 2 4 5 6 .. or will it update itself to 0 1 2 3 4 5 ... ??

3) How to remove single entry for say.. row ID 3 ??

4) How to edit an existing entry at any ID ??

thnx in advance ; )


1) The indexing is handled automatically by Core Data. You don't do anything with it.

2) Don't know, don't care because Core Data handles it.

3) You don't. Core Data is not a wrapper for SQl and does not concern itself with tables and rows. Core Data uses objects. When you delete a object Core Data removes it from the store.

4) You edit data by editing the properties of a specific managed object.

Core Data is not SQL. Entities are not tables. Objects are not rows. Columns are not attributes. Core Data is an object graph management system that may or may not persist the object graph and may or may not use SQL far behind the scenes to do so. Trying to think of Core Data in SQL terms will cause you to completely misunderstand Core Data and result in much grief and wasted time.


making a property indexable is a performance option. It does not add a sortable index that you can access from your application. What it does is make that property faster to search if you are using a SQLite store.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜