Without going into specifics and breaking NDA…
If a developer preview of OSX shows me that a certain API is now part of the AppKit where I previously had to implement the API as a category of the class how do I arrange things so something built and linked against that future SDK will still run on on the current OS.
So in an abstract sense in the current SDK for Lion I have the method coolThing defined in a Category of the class NSFooBar so I can call
object.thing = fooBarInstance.coolThing
However the future SDK shows me that coolThing is now provided by the SDK and hence my category conflicts at build time.
Can I ensure that my Application still works on Lion (where the symbol will not be available) when Im linked against the future SDK without this sort of mess.
if(OSVersion == Lion) {
return myImplementation;
}
else {
return SDKNativeImplementaion;
}
Which I suppose I could hide away in the Category but it seems like a bit of mess.
That’s the reason you should prefix your category methods. So instead of
coolThing, you could call itwb_coolThingor something like that. Your category method could check at runtime whether there is acoolThingmethod, call that if available or use your own implementation if not.