project-imas / encrypted-core-data

v2.0 - iOS Core Data encrypted SQLite store using SQLCipher
Other
785 stars 236 forks source link

Framework support missing #278

Open tomasz-czyzak opened 7 years ago

tomasz-czyzak commented 7 years ago

There is an issue when your database is delivered thru framework. During migration method: - (BOOL)loadMetadata:(NSError **)error { calls: [bundles addObject:[NSBundle mainBundle]]; as a result it can't find model delivered in framework bundle and migration fails. It should use: [[NSBundle bundleForClass:[self class]] or [NSBundle bundleWithIdentifier:modelBundleIdentifier]; where modelBundleIdentifier is being passed from application thru options dictionary

lolgear commented 7 years ago

@tomasz-czyzak does PR #268 fix it?

tomasz-czyzak commented 7 years ago

Looks ok however I didn't check it. This solution is based on passing whole bundle during init. While my private fix is based on passing only bundle id in options. Here is my private fix: https://github.com/project-imas/encrypted-core-data/pull/286