Universal builds/intel and core data fetch requests
Universal builds/intel and core data fetch requests
- Subject: Universal builds/intel and core data fetch requests
- From: Niko Matsakis <email@hidden>
- Date: Fri, 21 Jul 2006 16:41:29 +0200
I am having a problem using stored fetch requests in universal builds
with core data. I created a new project which has only a few lines of
code that reproduces the problem. It basically consists of a few
calls to framework routines; I've included the entirety of the code
below, and you can download the project from http://
smallcultfollowing.com/code/reproduce.zip.
The problem occurs only once you've added an entity. At that point,
attempts to execute the stored query either die with a segfault or
with an error message about some random class not responding to
"subentitiesByName." To reproduce it, you can download the project,
build and execute it, and simply click the buttons "1" and "2" in
turn. You will either get a crash or see a message in the output log.
As has been suggested, it *sounds* like a memory problem, but I don't
see anything with my code (you can check for yourself below).
Besides adding the two routines below, I added two entities with no
attributes and a stored query "1==1". I also added the two buttons
and connected them to the two routines. That's it.
The problem does not seem to occur if you only down a PPC build AND
you execute on PPC. If you do a universal or only i386 build, it
occurs. This is true on both PPC machines and intel machines. I
find it strange that even BUILDING an i386 build causes the problem,
even if you don't use it, but so it seems to be.
- (IBAction)button1:(id)sender
{
NSManagedObjectContext *managedObjectContext = [self
managedObjectContext];
[NSEntityDescription insertNewObjectForEntityForName:@"Meta"
inManagedObjectContext:managedObjectContext];
}
- (IBAction)button2:(id)sender
{
NSError *error;
NSManagedObjectContext *moc = [self managedObjectContext];
NSManagedObjectModel *model = [self managedObjectModel];
NSFetchRequest *fetchRequest =
[model fetchRequestFromTemplateWithName:@"foo"
substitutionVariables:[NSDictionary
dictionary]];
[moc executeFetchRequest:fetchRequest error:&error]; // **
EXCEPTION OCCURS HERE
}
Thank you in advance for any suggestions.
Niko Matsakis
_______________________________________________
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