• 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: OCUnit and main bundle
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: OCUnit and main bundle


  • Subject: Re: OCUnit and main bundle
  • From: Tim Hart <email@hidden>
  • Date: Thu, 17 Feb 2005 10:48:48 -0600

I don't' know how OCUnit's test frameworks are put together, but I imagine they are similar to TestKit's.

I had a similar problem with a test I was writing with TestKit, and determined that in my case it was more 'correct' to call

[NSBundle bundleForClass:[self class]];

than to look for the main bundle.

In my case, I realized that I wanted to pair the resource (the plist) with whatever bundle the class itself was compiled in - not the main bundle of the application.


On Thursday, February 17, 2005, at 10:16AM, Giuseppe Alletti <email@hidden> wrote:

>I have a project with two targets:
>1 - PageViewEditor, wich is the Cocoa app.
>2 - PageViewEditorTest, wich is a testing framework created with OCUnit.
>
>In the first target, I have a class that initializes a static variable
>with the content of a plist file. The path to the plist file is
>determined via [[NSBundle mainBundle] pathForResource:@"filename"
>ofType:@"plist"]
>
>When I use the class in the testing framework, the plist file is not
>found, since the path to mainBundle results to be /Developer/Tools.
>
>The testing framework is set to execute test cases at build time, via
>the Shell Script build phase created automatically by the target
>template.
>
>Is there a way to force the testing framework to resolve correctly the
>mainBundle path? Or otherwise is there a way to make my class read the
>right file differently?
>
>Thank you,
>-----------------------
>Giuseppe Alletti
> _______________________________________________
>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
>
>
 _______________________________________________
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

  • Follow-Ups:
    • Re: OCUnit and main bundle
      • From: Marco Scheurer <email@hidden>
References: 
 >OCUnit and main bundle (From: Giuseppe Alletti <email@hidden>)

  • Prev by Date: Re: Pushing Bindings to Far?
  • Next by Date: Re: Full screen transparent window
  • Previous by thread: OCUnit and main bundle
  • Next by thread: Re: OCUnit and main bundle
  • Index(es):
    • Date
    • Thread