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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to