[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Renaissance: initStarndardStaticNameTable question

From: Alexander Malmberg
Subject: Re: Renaissance: initStarndardStaticNameTable question
Date: Fri, 07 Nov 2003 03:06:29 +0100

Chris Hanson wrote:
> In the initStarndardStaticNameTable function
> (GSMarkupBundleAdditions.m) there's a lookup of first the NSApplication
> class and then the "sharedApplication" selector.  The class is then
> made to perform the selector using +performSelector:.
> This gives a compiler warning on Mac OS X 10.3 with Apple's GCC 3.3,
> saying Class may not respond to +performSelector:.

Compiler issue. Will be fixed in (normal, fsf) gcc 3.4.

> Obviously in this
> case it will, but I was wondering why it was done this way.
> It should be possible to replace the whole lookup dance with
>    [NSBundle registerStaticObject:[NSApplication sharedApplication]
>                          withName:@"NSApp"];
> shouldn't it?

Only if it's guaranteed to run after the NSApp instance has been
created, but in that case, it should use NSApp instead. Library code
should never send +sharedApplication (at least not to NSApplication)
because the app might want to use a custom NSApplication subclass.

- Alexander Malmberg

reply via email to

[Prev in Thread] Current Thread [Next in Thread]