Re: Core Data load document store without document for QuickLook plugin
Re: Core Data load document store without document for QuickLook plugin
- Subject: Re: Core Data load document store without document for QuickLook plugin
- From: David Sinclair <email@hidden>
- Date: Fri, 21 Dec 2007 12:16:06 -0800
On Dec 21, 2007, at 11:46:33, mmalc crawford wrote:
On Dec 21, 2007, at 11:32 AM, David Sinclair wrote:
It gives the error "The model configuration used to open the store
is incompatible with the one that was used to create the store."
I'm using the same xcdatamodel file as for the main app.
How did you get the model in the document-based app?
I'm not sure I understand that question. The model's .xcdatamodel
file is part of the app, and the NSPersistentDocument loads it
automatically. I explicitly load it in the QuickLook plugin via:
managedObjectModel = [[NSManagedObjectModel
mergedModelFromBundles:nil] retain];
In the document-based app, if I override -
configurePersistentStoreCoordinatorForURL:ofType:modelConfiguration:storeOptions:error
:, both modelConfiguration and storeOptions are nil.
In the app, are you linking against any frameworks that contain
managed object models that might be merged in with the app's model
and which would not be present in the importer?
Not sure. No non-Apple frameworks. In the app, I link against
Carbon, Cocoa, CoreFoundation, CoreServices, Foundation, AppKit,
ExceptionHandling, SystemConfiguration, AddressBook, CoreData, and
WebKit. The plugin wouldn't use several of those.
In case it helps, here's output from qlmanage -p, with some debug
logging from my plugin:
2007-12-21 12:08:40.239 qlmanage[1392:807] Testing quicklookd preview
with files:
(
"Once upon a time4.narrative"
)
2007-12-21 12:08:40.246 qlmanage[1392:807] [QL] Succesfully activated
built-in quicklookd sandbox profile
2007-12-21 12:08:40.341 qlmanage[1392:5603] [QL] Preview test for Once
upon a time4.narrative -- /Users/dejal/Development/Leopard/Narrator/
Test documents/. Content type UTI: com.dejal.narrator.document
2007-12-21 12:08:40.344 qlmanage[1392:6203] [QL] Registering
<QLGenerator Built-in> for public.image
<snip>
2007-12-21 12:08:40.403 qlmanage[1392:6203] [QL] Registering
<QLGenerator /Users/dejal/Development/Leopard/Narrator/build/Release/
Narrator.app/Contents/Library/QuickLook/Narrator.qlgenerator> for
com.dejal.narrator.document
2007-12-21 12:08:40.405 qlmanage[1392:5f03] [QL] Loading Plug-in for
<QLGenerator /Users/dejal/Development/Leopard/Narrator/build/Release/
Narrator.app/Contents/Library/QuickLook/Narrator.qlgenerator>
2007-12-21 12:08:40.432 qlmanage[1392:5f03] [QL] Previewing /Users/
dejal/Development/Leopard/Narrator/Test documents/Once upon a
time4.narrative. Content type UTI: com.dejal.narrator.document.
Generator used: <QLGenerator /Users/dejal/Development/Leopard/Narrator/
build/Release/Narrator.app/Contents/Library/QuickLook/
Narrator.qlgenerator>
2007-12-21 12:08:40.436 qlmanage[1392:5f03] model:
(<NSManagedObjectModel: 0x17f110>) isEditable 1, entities {
}, fetch request templates {
}; configs: (
)
2007-12-21 12:08:40.457 qlmanage[1392:5f03] coordinator:
<NSPersistentStoreCoordinator: 0x17ee30>; store = (null); error =
Error Domain=NSCocoaErrorDomain Code=134020 UserInfo=0x1856f0 "The
model configuration used to open the store is incompatible with the
one that was used to create the store."
2007-12-21 12:08:40.462 qlmanage[1392:5f03] url: file://localhost/Users/dejal/Development/Leopard/Narrator/Test documents/Once upon a time4.narrative
; context: <NSManagedObjectContext: 0x181540>
2007-12-21 12:08:40.463 qlmanage[1392:5f03] [QL ERROR] Preview request
generator for <QLPreviewRequest file://localhost/Users/dejal/Development/Leopard/Narrator/Test documents/Once upon a time4.narrative
> raised 'executeFetchRequest:error: A fetch request must have an
entity.'
2007-12-21 12:08:40.469 qlmanage[1392:6307] [QL] Thumbnailing Once
upon a time4.narrative -- /Users/dejal/Development/Leopard/
Narrator/Test documents/ (512 x 512). Content type UTI:
com.dejal.narrator.document. Generator used: <QLGenerator /Users/dejal/
Development/Leopard/Narrator/build/Release/Narrator.app/Contents/
Library/QuickLook/Narrator.qlgenerator>
2007-12-21 12:08:40.550 qlmanage[1392:6307] [QL] Thumbnailing for Once
upon a time4.narrative -- file://localhost/Users/dejal/Development/Leopard/Narrator/Test documents/
done (No image created).
--
David Sinclair, Dejal Systems, LLC - email@hidden
Dejal blog - http://www.dejal.com/blog/
Cocoa code - http://www.dejal.com/developer/
Now on Twitter - http://twitter.com/dejal/
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden