Re: NSBundle wierdness in OCUnit target:
Re: NSBundle wierdness in OCUnit target:
- Subject: Re: NSBundle wierdness in OCUnit target:
- From: Nir Soffer <email@hidden>
- Date: Tue, 11 Mar 2008 06:56:17 +0200
On Mar 11, 2008, at 01:44, William Hunt wrote:
Well, I think I've traced the weirdness I was previously having
with the model down to the following...
When I call:
NSLog( @"bundlePath: %@", [[NSBundle mainBundle] bundlePath] );
I get:
2008-03-10 16:41:18.565 otest[3819:80f] bundlePath: /Developer/Tools
This is clearly not correct. (I get the correct path to my .app
bundle when I run my normal target.) Is there a setting in the
target that changes the bundle path?
If you want to use test code that works with both dependent
(injected) and independent tests target, use:
NSBundle *testBundle = [NSBundle bundleForClass:[SomeClass class]];
SomeClass is either in the test bundle or in the tested code.
Best Regards,
Nir Soffer
_______________________________________________
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