Re: when __bridge isn't required
Re: when __bridge isn't required
- Subject: Re: when __bridge isn't required
- From: Quincey Morris <email@hidden>
- Date: Sat, 27 Jul 2013 12:10:31 -0700
On Jul 27, 2013, at 11:54 , Robert Martin <email@hidden> 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 <email@hidden> 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 (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