Creation of model in core data on the fly

Posted by user1740045 on Stack Overflow See other posts from Stack Overflow or by user1740045
Published on 2012-10-12T07:32:12Z Indexed on 2012/11/27 5:04 UTC
Read the original article Hit count: 167

Filed under:
|
|
|

How can we create a model in core data on the fly? I.e getting the schema of database from somewhere and then creating a Core Data Object graph?

*QuesTion:* Yes thats fine, agreed with all the advantages. But, can anybody can tell practically, what is the benefit of integrating Core Data into project instead of using SQL directly.

1.No need to write SQL boiler plate code [but need to learn Core Data Model (steep curve)] 2.WE can undo and redo changes [but practically who needs it] 3.we can migrate to another schema [that can be done by SQLite as well jus need to add another field into table] 4.For say aggregation on some field in table,in Core Data we need to loop through Core Data Objects whereas in SQLite we need to first write SQLite Boiler Plate Code and then the basic aggregation SQL query,which is easy to write,only length of code will increase...But in case of Core Data (need to learn a lot).

So apart from reducing the length of Code,does it actually adds value to project? or in terms of Memory Efficiency,Performance,etc..

PS: If anybody has actualy worked on Core Data(Model Creation On the Fly) , if possible share and gve pointers..thanks!

© Stack Overflow or respective owner

Related posts about iphone

Related posts about objective-c