Re: Strange Managed Context Error
Re: Strange Managed Context Error
- Subject: Re: Strange Managed Context Error
- From: Colin Cornaby <email@hidden>
- Date: Sat, 20 Aug 2005 19:37:42 -0700
On Aug 20, 2005, at 3:36 PM, mmalcolm crawford wrote:
On Aug 20, 2005, at 3:21 PM, Colin Cornaby wrote:
Could you please elaborate...?
I'm providing methods to abstract querying code, in addition to
allowing on the fly declaration of the subclass. The subclass will
automatically set up it's schema, and also has an initFromFile method
to abstract opening from a file. Basically I don't want to keep re-
writing redundant CoreData code within my applications, and I also
want to work with objects in my applications. I'm using these object
classes to abstract the CoreData data structure beneath them. The
schema is also configured with the proper classes.
If you're using a subclass of NSManagedObjectContext then no, it's
not done automatically. How have you configured it?
The following is the first part of my init method (the relevent part):
-(id)init{
self = [super init];
//Set up our store co-ordinator using our schema
NSPersistentStoreCoordinator *coordinator
= [[NSPersistentStoreCoordinator alloc]
initWithManagedObjectModel:
[[NSManagedObjectModel mergedModelFromBundles:[NSArray
arrayWithObjects:[NSBundle bundleForClass:[self class]], nil]] retain]];
//Set this context to use our new store co-ordinator
[self setPersistentStoreCoordinator: coordinator];
The odd NSBundle code is because this code and the schema is within a
framework.
You've reconfigured something. If you haven't done so correctly
then odd behaviour is likely to occur. Please give more details
about what you've actually done, otherwise it's impossible to give
more help.
As I said, it only happens within this one method, which isn't doing
much special. All other queries work just fine. And this query still
works and returns the right information. I just want to find out why
it's logging this message.
---------------------------
Colin Cornaby
ProToys - White Magic Labs - http://whitemagiclabs.com
Macintosh Specialist - University of Portland - htttp://up.edu
---------------------------
Colin Cornaby
ProToys - White Magic Labs - http://whitemagiclabs.com
Macintosh Specialist - University of Portland - htttp://up.edu
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden