• 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: Loading a class with a specific superclass from a bundle
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Loading a class with a specific superclass from a bundle


  • Subject: Re: Loading a class with a specific superclass from a bundle
  • From: Negm-Awad Amin <email@hidden>
  • Date: Tue, 5 Aug 2008 21:00:30 +0200


Am Di,05.08.2008 um 20:41 schrieb Bill Bumgarner:

On Aug 5, 2008, at 11:19 AM, Elan Feingold wrote:
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?

"class *without* a principal class" doesn't make sense.

- all bundles have a principal class, automatically (and semi- randomly) chosen if you don't specify it

- all classes have a super class (unless it is a root class)

If you go to the target inspector's Properties tab in your Xcode project, you can specifically set the bundle's principal class.

b.bum
If I understood this mail correct, he has a bundle with a class C, which is not the principal class, but a (single?) subclass of another (propably abstract?) class T (which can change). He does not know the name of C and tries to iterate through all classes in the bundle to find it.

- (Class)loadSubclassOfClass:(Class)T {
// ???
}

IIRC, somebody wrote code to extract classes (on a first step class names) from a bundle. I couldn''t google it. :-(

I understand the problem, that he does not know the subclass C of the bundle class T in the loading application. But the programmer of the bundle knows "his" class hierarchy. So he can write a principal class with the intention to return all classes in that bundle. The principal class only needs a class methode +myClassHierarchy.

Amin


_______________________________________________

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

Amin Negm-Awad email@hidden




_______________________________________________

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


References: 
 >Loading a class with a specific superclass from a bundle (From: Elan Feingold <email@hidden>)
 >Re: Loading a class with a specific superclass from a bundle (From: Bill Bumgarner <email@hidden>)

  • Prev by Date: Re: Loading a class with a specific superclass from a bundle
  • Next by Date: Re: GetDblTime, 64-bit, and cocoa
  • Previous by thread: Re: Loading a class with a specific superclass from a bundle
  • Next by thread: Re: Loading a class with a specific superclass from a bundle
  • Index(es):
    • Date
    • Thread