Skip navigation.
 
mlusing new APIs with old OS versions
FROM : Bob Clark
DATE : Sun Jul 23 23:20:55 2006

I've got a subclass of NSLevelIndicatorCell that I use when I'm on 
Tiger and later. If I'm on Panther or earlier I subclass NSCell and 
make do with a (not-as-nice-looking) version.

(NSLevelIndicatorCell was introduced in Tiger.)

But it's not launching on Panther -- it seems as though even though I 
don't use NSLevelIndicatorCell on Panther, the run-time linking on 
Panther sees that "something" in my application is referring to 
NSLevelIndicatorCell and it fails to launch.

My .h file looks something like this:

@interface CustomCellTiger : NSLevelIndicatorCell
{
    // custom stuff
}
@end

@interface CustomCellPanther : NSCell
{
    // custom stuff
}
@end

Then in the code when I need to instantiate one of my custom cells, I 
use Gestalt to check for what OS version I'm running, and if it's 
Tiger or later I'll create a CustomCellTiger and if it's Panther or 
earlier I'll create a CustomCellPanther.

Is there an approach that will not preemptively abort launch on 
Panther? The only approach I can think of (aside from abandoning my 
attempt to subclass from NSLevelIndicatorCell) is to have the 
CustomCellTiger definition and implementation in a separate NSBundle, 
which is only loaded under Tiger. But man, that feels like a lot of 
effort just to salvage the small-and-shrinking Panther user base.

--Bob

Related mailsAuthorDate
mlusing new APIs with old OS versions Bob Clark Jul 23, 23:20
mlRe: using new APIs with old OS versions Nick Zitzmann Jul 23, 23:49
mlRe: using new APIs with old OS versions Jerry Krinock Jul 24, 21:21
mlRe: using new APIs with old OS versions Bob Clark Jul 25, 07:33