Re: How to use a class, which may not be available
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.