• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Using Core Data with OCUnit
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Using Core Data with OCUnit
      • From: Bill Garrison <email@hidden>
References: 
 >Using Core Data with OCUnit (From: William Hunt <email@hidden>)
 >Re: Using Core Data with OCUnit (From: Chris Hanson <email@hidden>)

  • Prev by Date: Re: results in attached view
  • Next by Date: Re: fileExistsAtPath with * to indicate random
  • Previous by thread: Re: Using Core Data with OCUnit
  • Next by thread: Re: Using Core Data with OCUnit
  • Index(es):
    • Date
    • Thread