Re: Loading a class with a specific superclass from a bundle
Re: Loading a class with a specific superclass from a bundle
- Subject: Re: Loading a class with a specific superclass from a bundle
- From: "Michael Ash" <email@hidden>
- Date: Tue, 5 Aug 2008 15:32:46 -0400
On Tue, Aug 5, 2008 at 2:19 PM, Elan Feingold <email@hidden> wrote:
> Hi,
>
> I can load the principal class of a bundle with:
>
> NSBundle* bundleToLoad = [NSBundle bundleWithPath:@"..."];
> Class exampleClass = [bundleToLoad principalClass]);
>
> However, I have a situation where I have a bundle that has a class *without*
> a principal class, but it has a class that is a subclass of a specific other
> class. Is there any way to iterate through classes offered by a bundle and
> pick out the ones that derive from a specific superclass?
Start here:
http://www.cocoadev.com/index.pl?FindingAllSubclassesOfAClass
Using that code as a base, it's pretty easy to add an extra filter
that checks the bundle of each returned class and accepts only those
that are in the specified bundle.
Mike
_______________________________________________
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