Re: Issues with NSWindowDelegate on multiple Mac OS X platforms
Le 7 oct. 2009 à 06:42, Kyle Sluder a écrit : Please read the 10.6 Foundation release notes, particularly the section entitled Formal protocol adoption: http://developer.apple.com/mac/library/releasenotes/Cocoa/Foundation.html We compile dual-mode code using the following: @interface Subclass : Superclass #if MAC_OS_X_VERSION_MIN_REQUIRED = MAC_OS_X_VERSION_10_6 ConformingProtocol #endif In the case of conformance to multiple protocols, some of which are unavailable pre-10.6, we use this: @interface Subclass : Superclass Protocol1 #if MAC_OS_X_VERSION_MIN_REQUIRED = MAC_OS_X_VERSION_10_6 ,Protocol2 #endif It's a mess, but it works, and the benefit of static type checking far outweighs the cost. (And it also motivates you to drop 10.5 support. :D) --Kyle Sluder That's the way to go, but MAC_OS_X_VERSION_10_6 is not defined on 10.5 SDK. So you have to add another couple of line at the top of the file (or in a prefix header): #ifndef MAC_OS_X_VERSION_10_6 #define MAC_OS_X_VERSION_10_6 1060 #endif -- Jean-Daniel ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Issues with NSWindowDelegate on multiple Mac OS X platforms
On Tue, Oct 6, 2009 at 11:23 PM, Jean-Daniel Dupas devli...@shadowlab.org wrote: That's the way to go, but MAC_OS_X_VERSION_10_6 is not defined on 10.5 SDK. Grr, yes, you are of course correct. So you have to add another couple of line at the top of the file (or in a prefix header): I always thought it was kind of nasty to have to make modifications to the SDK or to port changes back from newer SDKs to older ones. At the very least, I think as new SDKs are released, AvailabilityMacros.h should be updated in the older SDKs. --Kyle Sluder ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Issues with NSWindowDelegate on multiple Mac OS X platforms
Please read the 10.6 Foundation release notes, particularly the section entitled Formal protocol adoption: http://developer.apple.com/mac/library/releasenotes/Cocoa/Foundation.html We compile dual-mode code using the following: @interface Subclass : Superclass #if MAC_OS_X_VERSION_MIN_REQUIRED = MAC_OS_X_VERSION_10_6 ConformingProtocol #endif In the case of conformance to multiple protocols, some of which are unavailable pre-10.6, we use this: @interface Subclass : Superclass Protocol1 #if MAC_OS_X_VERSION_MIN_REQUIRED = MAC_OS_X_VERSION_10_6 ,Protocol2 #endif It's a mess, but it works, and the benefit of static type checking far outweighs the cost. (And it also motivates you to drop 10.5 support. :D) --Kyle Sluder ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com