Re: Deprecated APIs
Re: Deprecated APIs
- Subject: Re: Deprecated APIs
- From: Greg Parker <email@hidden>
- Date: Wed, 24 Feb 2010 12:04:35 -0800
On Feb 24, 2010, at 11:36 AM, Steve Christensen wrote:
> On Feb 24, 2010, at 11:04 AM, Bill Bumgarner wrote:
>> On Feb 23, 2010, at 8:57 PM, Steve Christensen wrote:
>>>> That code uses blocks, though, which implies that it will be compiled using a later version of Objective-C. Will that code really run on older versions of OS X?
>>>
>>> The compile-time conditional assumes that you're building against the 10.6 SDK (or later). Obviously if you're going to support both cases, you'll need to use a compiler configuration that is compatible with all the OS versions you plan to support.
>>
>> There are symbols *sometimes* emitted by compilation of blocks that won't be available on prior releases of Mac OS X and, thus, will cause a dyld error on launch on those platforms.
>>
>> Be careful.
>
> Is this the case even if you're weak-linking against 10.6, i.e., you're setting the deployment target to 10.4? And is this a blocks-specific issue? I don't recall ever having problems with other cases when I wanted to call a newer API method conditional on the OS version.
In the blocks case, the symbol references are in the Objective-C metadata and the guts of the block itself. Currently it's Officially Unsupported, even with weak linking. In practice, it may or may not work, depending on exactly what your code looks like and whether I've forgotten anything.
On some architectures, weak-linking to an Objective-C class means the Objective-C metadata will have a NULL pointer in it at runtime when the class is absent. On some OS versions, the Objective-C runtime will crash if it sees those NULL pointers. Providing better support for this is in progress, but of course that won't help the existing old OS versions.
If you can verify that the app launches on all OS versions and all architectures you care about, and you're very careful not to do anything at all with any block object on the wrong OS, then you might be safe.
--
Greg Parker email@hidden Runtime Wrangler
_______________________________________________
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