开发者

COMPILED Core Data Managed Object Model: Get maximum info from it and its corresponding database

开发者 https://www.devze.com 2023-01-12 08:56 出处:网络
I am a novice in Objective-C; and I could not find any solution in my Books or internet. My question: What are the most efficient and fastest ways to use already compiled .mom and SQLite db without h

I am a novice in Objective-C; and I could not find any solution in my Books or internet.

My question: What are the most efficient and fastest ways to use already compiled .mom and SQLite db without having the source codes?

Details:开发者_JAVA技巧 I am trying to connect my small app to the database of another application and use (read-inly) the part of its data. But the task is difficult since that app does not have SDK.

That app has a compiled .mom file and an SQLite database.

I succeeded to programmatically (not using IB) connect to the db using .mom and could manage to get the entities, fill data into the objects re-created by me etc. But I am doing every step with guesses, trials and errors. Thus the development takes a lot of time and is error-prone. The most difficult task to dissect is to-many relationships via intermediate tables.

For example: entity "Books" has a relationship to "Authors". Since the sequence of authors matters, there is an intermediate table "authorsNumbered" which contains fields: number, author, book; and the field "number" determines the exact order of authors as they should appear everywhere (important!)

I finally managed to create an ordered array of authors using NSSortDescriptor but it took me whole week to find and guess how to do it!

Would you suggest more efficient ways to deal with compiled .mom rather than the one used by me?

Thanks


If you copy the .mom file and change the extension to .plist you will get a plain text, human readable plist file which you can puzzle out with relative ease.


  1. Create a empty model file say Example.exdatamodeld.

  2. Select it.

  3. In Xcode Editor -> Import and select your mom file.

  4. You can view datamodel inside that mom file.

0

精彩评论

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

关注公众号