Re: Conditional Compilation for 10.9/10.10...
On Jan 2, 2015, at 09:35 , Peters, Brandon bap...@my.fsu.edu wrote: I am trying set up my application to do some condition compilation to address a deprecated method in 10.9 that has been replaced in 10.10 with another method. I am running Xcode Version 6.2 (6C86e, beta). Here is the code: #if MAC_OS_X_VERSION_MIN_REQUIRED = MAC_OS_X_VERSION_10_9 -(NSRect)constrainBoundsRect:(NSRect)proposedBounds { I’m pretty sure I don’t want to get tangled up in this, because I’m very bad at OS-version-dependent reasoning, but I’ll point out that ‘constrainBoundsRect:’ was apparently introduced in 10.9, not 10.10. OTOH, ‘constrainScrollPoint:’ was informally deprecated in 10.9, and only formally deprecated in 10.10. It’s not clear to me whether you’re trying to distinguish between 10.9 vs 10.10, or 10.8- vs 10.9+. Your comments suggest the former, but if so you don’t actually have to make the distinction. If the latter, then shouldn’t the test be ‘=‘ rather than ‘=‘? If you’re trying to *override* ‘constrainBoundsRect:’, you need a deployment target of at least 10.9. OTOH if you’re trying to supply the “missing” ‘constrainBoundsRect:’, then you really shouldn’t do that — you don’t know if it might have been a private method previously. On top of all that, according to the NSClipView.h header file, there is a compatibility mode if the deprecated ‘constrainScrollPoint:’ is actually overridden, so it’s possible that none of this is actually necessary. But I’m probably confused … ___ 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Conditional Compilation for 10.9/10.10...
#if MAC_OS_X_VERSION_MIN_REQUIRED = MAC_OS_X_VERSION_10_9 This is a compile-time conditional so it will be true as long as you are building with a pre-10.10 deployment target, thus -constrainScrollPoint: will never be compiled in. You should put the #if … #endif around -constrainBoundsRect: so that it's available as long as you're deploying to 10.9. You could then either implement -constrainBoundsRect: to do one thing and -constrainScrollPoint: do something slightly different, or you could calculate a newOrigin value based on proposedBounds in -constrainBoundsRect: and pass that into -constrainScrollPoint: to do the actual work so that it's handled in the method that will be living on into the future. On Jan 2, 2015, at 9:35 AM, Peters, Brandon bap...@my.fsu.edu wrote: Hello, I am trying set up my application to do some condition compilation to address a deprecated method in 10.9 that has been replaced in 10.10 with another method. I am running Xcode Version 6.2 (6C86e, beta). Here is the code: #if MAC_OS_X_VERSION_MIN_REQUIRED = MAC_OS_X_VERSION_10_9 -(NSRect)constrainBoundsRect:(NSRect)proposedBounds { // code... } #else -(NSPoint)constrainScrollPoint:(NSPoint)newOrigin { // code... } #endif In the build settings, I set the target OS and base SDK to 10.10, but the method used in the program was still the first one when it should have been the second one. I figured out that MAC_OS_X_VERSION_MIN_REQUIRED stayed at ‘1090’ regardless of my build settings. Is there a way to set that to 1010? Or is there another way to perform the conditional compilation? Also, I noticed there was no macro MAC_OS_X_VERSION_10_10. ___ 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Conditional Compilation for 10.9/10.10...
You can’t do this via conditional compilation unless you want to create specific versions of the application for 10.10 vs 10.9. If you want to support both versions in one application, implement both methods - typically the non-deprecated method will be called on OSes where it is supported and the deprecated method called on previous OSes. As for your actually issue, you probably have a target setting overriding a project setting. On Jan 2, 2015, at 9:35 AM, Peters, Brandon bap...@my.fsu.edu wrote: Hello, I am trying set up my application to do some condition compilation to address a deprecated method in 10.9 that has been replaced in 10.10 with another method. I am running Xcode Version 6.2 (6C86e, beta). Here is the code: #if MAC_OS_X_VERSION_MIN_REQUIRED = MAC_OS_X_VERSION_10_9 -(NSRect)constrainBoundsRect:(NSRect)proposedBounds { // code... } #else -(NSPoint)constrainScrollPoint:(NSPoint)newOrigin { // code... } #endif In the build settings, I set the target OS and base SDK to 10.10, but the method used in the program was still the first one when it should have been the second one. I figured out that MAC_OS_X_VERSION_MIN_REQUIRED stayed at ‘1090’ regardless of my build settings. Is there a way to set that to 1010? Or is there another way to perform the conditional compilation? Also, I noticed there was no macro MAC_OS_X_VERSION_10_10. ___ 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: https://lists.apple.com/mailman/options/cocoa-dev/david.duncan%40apple.com This email sent to david.dun...@apple.com -- David Duncan ___ 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Conditional Compilation for 10.9/10.10...
Hello, I am trying set up my application to do some condition compilation to address a deprecated method in 10.9 that has been replaced in 10.10 with another method. I am running Xcode Version 6.2 (6C86e, beta). Here is the code: #if MAC_OS_X_VERSION_MIN_REQUIRED = MAC_OS_X_VERSION_10_9 -(NSRect)constrainBoundsRect:(NSRect)proposedBounds { // code... } #else -(NSPoint)constrainScrollPoint:(NSPoint)newOrigin { // code... } #endif In the build settings, I set the target OS and base SDK to 10.10, but the method used in the program was still the first one when it should have been the second one. I figured out that MAC_OS_X_VERSION_MIN_REQUIRED stayed at ‘1090’ regardless of my build settings. Is there a way to set that to 1010? Or is there another way to perform the conditional compilation? Also, I noticed there was no macro MAC_OS_X_VERSION_10_10. ___ 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Conditional Compilation for 10.9/10.10...
Quincy, Yeah, I got the two mixed up in the wording but you got the general theme. David Duncan, Thanks, I took out the #’s and just have both methods override. Thanks to all for viewing and helping. On Jan 2, 2015, at 11:14 AM, Quincey Morris quinceymor...@rivergatesoftware.commailto:quinceymor...@rivergatesoftware.com wrote: . ___ 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com