Re: Gestalt
Re: Gestalt
- Subject: Re: Gestalt
- From: Jean-Daniel Dupas <email@hidden>
- Date: Thu, 22 Sep 2011 16:54:31 +0200
Le 22 sept. 2011 à 16:37, AM a écrit :
>
> On Sep 21, 2011, at 6:09 PM, Conrad Shultz wrote:
>
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> On 9/21/11 2:22 PM, Charles Srstka wrote:
>>> Why not? I find it to be safer than checking for the existence of
>>> a method, because you never know if that method might have actually
>>> have existed before it went public, but in a less stable form or
>>> with different behavior. If this is the case, then just checking
>>> whether the method exists and calling it could produce who knows
>>> what behavior on older systems.
>>
>> I have always been under the impression that Apple recommends weak
>> linking and run-time checks. It's what's covered in the (aging) Tech
>> Note 2064 for OS X and, IIRC, is what is discussed in, for example,
>> the original iPad/iOS 3.2 release notes.
>>
>> What are some examples of breakage happening under this scenario? I'd
>> like to be on the lookout myself if I indeed did put too much faith in
>> the documentation.
>
> One relevant case I encountered was a leak in CFFileDescriptor which occurred on 10.5 but was fixed in 10.6. Under 10.5 (when detected), I had to manually close a leaked file descriptor.
>
For bugs specifics to a framework version, I prefer to use the framework provided constants instead of gestalt.
if (kCFCoreFoundationVersionNumber <= kCFCoreFoundationVersionNumber10_6)
// close manually.
> Cheers,
> M_______________________________________________
>
> 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
-- Jean-Daniel
_______________________________________________
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