From: Pierce T. W. I. <pi...@tw...> - 2008-02-29 18:40:58
Attachments:
smime.p7s
|
The code: @storeMetaDeta =NSPersistentStore.metadataForPersistentStoreWithURL_error(url,error) The error: 2008-02-29 10:36:04.750 Frictionless[48280:813] AppDelegate#openAllWindows: OSX::OCException: NSInvalidArgumentException - *** - metadataForPersistentStoreWithURL:error: cannot be sent to an abstract object of class NSPersistentStore: Create a concrete instance! |
From: Avram L. <aj...@gm...> - 2008-02-29 18:50:44
|
On Fri, Feb 29, 2008 at 9:40 PM, Pierce T. Wetter III <pi...@tw...> wrote: > The code: > > @storeMetaDeta > =NSPersistentStore.metadataForPersistentStoreWithURL_error(url,error) Looking at the class documentation (http://developer.apple.com/documentation/Cocoa/Reference/NSPersistentStore_Class/Reference/NSPersistentStore.html#//apple_ref/occ/clm/NSPersistentStore/metadataForPersistentStoreWithURL:error:), NSPersistentStore.metadataForPersistentStoreWithURL_error is supposed to be a class method. Could RubyCocoa be mangling the mapping? Try initializing a store instance with initWithPersistentStoreCoordinator:configurationName:URL:options: and then use metadataForPersistentStoreWithURL_error on the instance. I realize that defeats the purpose of getting metadata with a class and not instance method, but it might help understand what's going on. Avram |
From: Pierce T. W. I. <pi...@tw...> - 2008-02-29 21:21:08
Attachments:
smime.p7s
|
On Feb 29, 2008, at 10:50 AM, Avram Lyon wrote: > On Fri, Feb 29, 2008 at 9:40 PM, Pierce T. Wetter III > <pi...@tw...> wrote: >> The code: >> >> @storeMetaDeta >> =NSPersistentStore.metadataForPersistentStoreWithURL_error(url,error) > > Looking at the class documentation > (http://developer.apple.com/documentation/Cocoa/Reference/NSPersistentStore_Class/Reference/NSPersistentStore.html#/ > /apple_ref/occ/clm/NSPersistentStore/ > metadataForPersistentStoreWithURL:error:), > NSPersistentStore.metadataForPersistentStoreWithURL_error is supposed > to be a class method. Yes, it is. > > > Could RubyCocoa be mangling the mapping? > > Try initializing a store instance with > initWithPersistentStoreCoordinator:configurationName:URL:options: and > then use metadataForPersistentStoreWithURL_error on the instance. I > realize that defeats the purpose of getting metadata with a class and > not instance method, but it might help understand what's going on. I'm in sort of a catch-22. I can't build a persistentStoreCoordinator without an NSManagedObjectModel. I can't build one of those because @managedObjectModel = OSX::NSManagedObjectModel.mergedModelFromBundles(allBundles.allObjects) is choking, giving me an exception for trying to insert nil in an NSArray. So I'm trying to do this instead: @managedObjectModel = OSX ::NSManagedObjectModel .mergedModelFromBundles_forStoreMetaData (allBundles.allObjects,@storeMetaData) but in order to do that, I have to be able to extract the metadata from the file without creating a store... Pierce |
From: Pierce T. W. I. <pi...@tw...> - 2008-02-29 22:43:10
Attachments:
smime.p7s
|
> > hmm.... Seems there's a: + (NSDictionary *)metadataForPersistentStoreOfType:(NSString *)storeType URL:(NSURL *)url error:(NSError **)error declared in the online docs, but not in my XCode docs. http://developer.apple.com/documentation/Cocoa/Reference/CoreDataFramework/Classes/NSPersistentStoreCoordinator_Class/Reference/NSPersistentStoreCoordinator.html#/ /apple_ref/doc/uid/TP30001180-SW5 Pierce |
From: Eloy D. <e....@su...> - 2008-02-29 23:06:22
|
Hi Pierce, I haven't looked at the dcoumentation, but I'm guessing that the error is passed as a pointer, which doesn't work in RC. So what the bridge will do for you is recognize this and simply return and new NSError instance for you. So the method call should look like: @storeMetaDeta, error = NSPersistentStore.metadataForPersistentStoreWithURL_error(url) As you can see we only pass 1 arg and 2 objects will be returned. Cheers, Eloy On 29 feb 2008, at 19:40, Pierce T. Wetter III wrote: > > The code: > > > @storeMetaDeta > =NSPersistentStore.metadataForPersistentStoreWithURL_error(url,error) > > The error: > > 2008-02-29 10:36:04.750 Frictionless[48280:813] > AppDelegate#openAllWindows: OSX::OCException: > NSInvalidArgumentException - *** - > metadataForPersistentStoreWithURL:error: cannot be sent to an > abstract object of class NSPersistentStore: Create a concrete > instance! > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/_______________________________________________ > Rubycocoa-talk mailing list > Rub...@li... > https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk |