Re: Issues with NSWindowDelegate on multiple Mac OS X platforms
Re: Issues with NSWindowDelegate on multiple Mac OS X platforms
- Subject: Re: Issues with NSWindowDelegate on multiple Mac OS X platforms
- From: Kyle Sluder <email@hidden>
- Date: Tue, 6 Oct 2009 21:42:21 -0700
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 (email@hidden)
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:
This email sent to email@hidden