• 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: How to use a class, which may not be available
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to use a class, which may not be available


  • Subject: Re: How to use a class, which may not be available
  • From: Alastair Houghton <email@hidden>
  • Date: Fri, 30 Jan 2004 19:03:05 +0000

On 30 Jan 2004, at 18:21, m wrote:

> On Jan 30, 2004, at 6:28 AM, Alastair Houghton wrote:
>
>> Take a look at section 3.7.5 of my FAQ, here:
>>
>> http://www.alastairs-place.net/cocoa/faq.txt
>
> Thank you, but your FAQ only covers part of solution and doesn't cover
> the situation where you may have subclassed an unavailable class.

Well it seems a bit hacky, but you try something like

@interface MyClass : NSObject

...

@end

then

Class fooClass = objc_lookUpClass ("Foo");
Class myClass = [MyClass class];

if (fooClass)
myClass->super_class = fooClass;

so that MyClass either ends-up as a subclass of NSObject or of "Foo",
depending on whether or not "Foo" can be found.

Kind regards,

Alastair.

[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: How to use a class, which may not be available
      • From: m <email@hidden>
References: 
 >How to use a class, which may not be available (From: Stefan Pantke <email@hidden>)
 >Re: How to use a class, which may not be available (From: j o a r <email@hidden>)
 >Re: How to use a class, which may not be available (From: m <email@hidden>)
 >Re: How to use a class, which may not be available (From: Alastair Houghton <email@hidden>)
 >Re: How to use a class, which may not be available (From: m <email@hidden>)

  • Prev by Date: Re: Objective C language [NEWBEE QUESTIONS]
  • Next by Date: pasteboard and animated gif image ??
  • Previous by thread: Re: How to use a class, which may not be available
  • Next by thread: Re: How to use a class, which may not be available
  • Index(es):
    • Date
    • Thread