Re: Using Core Data with OCUnit
Re: Using Core Data with OCUnit
- Subject: Re: Using Core Data with OCUnit
- From: William Hunt <email@hidden>
- Date: Mon, 10 Mar 2008 16:34:50 -0700
On Mar 10, 2008, at 11:19 AM, Chris Hanson wrote:
- (NSManagedObjectModel *)managedObjectModel {
if (_managedObjectModel == nil) {
NSString *modelPath = [[NSBundle mainBundle]
pathForResource:@"MyModel" ofType:@"mom"];
NSURL *modelURL = [NSURL fileURLWithPath:modelPath
isDirectory:NO];
_managedObjectModel = [[NSManagedObjectModel alloc]
initWithContentsOfURL:modelURL];
}
return _managedObjectModel;
}
Unfortunately, that didn't appear to work. I don't think it's finding
the model resource for some reason:
NSString *modelPath = [[NSBundle mainBundle]
pathForResource:@"Mapper"
ofType:@"mom"];
NSLog( @"modelPath: %@", modelPath );
results in:
2008-03-10 16:27:58.059 otest[3704:80f] modelPath: (null)
Again, I did verify the presence of a valid file at what I presume is
the correct location (relative to the project directory): build/
release/Full\ Test\ Suite.octest/Contents/Resources/Mapper.mom
Do I need to reconfigure my bundle object to look at a specific place
for its resources? I'll look into that in the mean time, I guess.
Thanks again for your help!
Wil
--
Wil Hunt
"Life is the art of drawing sufficient conclusions from insufficient
premises."
-- Samuel Butler
_______________________________________________
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