• 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
Bundles: debugging and more
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bundles: debugging and more


  • Subject: Bundles: debugging and more
  • From: Rainer Brockerhoff <email@hidden>
  • Date: Tue, 31 Jul 2001 12:38:41 -0300

>Date: Tue, 31 Jul 2001 13:41:25 +0200
>From: =?iso-8859-1?Q?"Daniel=20K=E4smayr"?= <email@hidden>
>
>I have an application that is designed in a way that most functionality sits inside of seperate Bundles. Like a "Viewer" bundle, one uses OpenGL, another uses Quartz, etc. Everything works fine ecxept 2 things:
>
>1. How do I debug code that is inside a bundle? When I set a break point in Project Builder the code doesnt stop when I run the debugger. Of course, I run the debugger on the main app, since the bundle itself wont run...is there a way to do this?

I've successfully done this inside a multi-target project; one target is the main app, the other the bundle. Setting breakpoints inside the bundle works OK.

If you can't do a multi-target project, try having both projects open while debugging...


>Date: Tue, 31 Jul 2001 05:06:26 -0700
>From: "John C. Randolph" <email@hidden>
> >
>> 2. When I have code inside the bundle and want to access resources
>> contained in it, how would I get the path info for it? [NSBundle
>> mainBundle] gives me the main app, not the bundle...
>
>Classes within your bundle can call [NSBundle bundleForClass:[self
>class]] .

The way I do this is as follows:

static NSBundle* thisBundle = nil;

@implementation mainBundleClass

+ (void) bundleInitialize {
if (!thisBundle) {
thisBundle = [NSBundle bundleForClass:[self class]];
}
}

Usually you would load the bundle and call [mainBundleClass bundleInitialize] first, then all mainBundleClass's methods can call [thisBundle pathForImageResource:@"foo"], for instance.


--
Rainer Brockerhoff <email@hidden>
Belo Horizonte, Brazil
"In the affairs of others even fools are wise
In their own business even sages err."
http://www.brockerhoff.net/ (updated July 2000)


  • Follow-Ups:
    • Re: Bundles: debugging and more
      • From: email@hidden
  • Prev by Date: converting local NSRect to global
  • Next by Date: RE: Searchable archives
  • Previous by thread: Re: Bundles: debugging and more
  • Next by thread: Re: Bundles: debugging and more
  • Index(es):
    • Date
    • Thread