On Jul 27, 2013, at 11:54 , Robert Martin <robmar...@frontiernet.net> wrote:

> But CGImageSourceCreateWithURL() includes the keyword 'create' - so the 
> object you get back has a retain count of 1. ARC will insist that you cast 
> with __bridge or __bridge_transfer.

ARC isn't involved with the return value in either case. In the first one, it's 
a scalar, as you noted. In the second, it's a core foundation object, which 
isn't managed by ARC …

… unless the CGImageSourceCreateWithURL is marked (in the SDK) with the 
attribute that that says it can be managed by ARC (a fairly recent addition to 
Clang) …

… but that wouldn't be it anyway, since there's no cast needed on the return 
value, let alone a __bridge.

On Jul 27, 2013, at 11:31 , Matt Neuburg <m...@tidbits.com> wrote:

> The first one compiles (with no explicit __bridge). The second one doesn't; 
> you must say __bridge explicitly.


I tried both your examples in Xcode 4.6.3 and OS X 10.8 SDK, and neither 
produced an error or a warning.

The answer to your question probably depends on:

-- the version of Clang you're using
-- the particular SDK you're using
-- the compiler options you're using

_______________________________________________

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

Reply via email to