Hello,

I already found the cause of my problem. The api I used for 10.6 has a 
NS_BLOCKS_AVAILABLE condition that is why my app crashes. Its not because of my 
OS Version conditions


Please close this issue.




________________________________
From: Greg Parker <gpar...@apple.com>
To: Steve Christensen <puns...@mac.com>
Cc: cocoa-dev@lists.apple.com
Sent: Thursday, February 25, 2010 4:04:35
Subject: Re: Deprecated APIs

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    gpar...@apple.com     Runtime Wrangler

_______________________________________________

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/cnapenas%40yahoo.com

This email sent to cnape...@yahoo.com



      Get your preferred Email name!
Now you can @ymail.com and @rocketmail.com. 
http://mail.promotions.yahoo.com/newdomains/aa/
_______________________________________________

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

Reply via email to