Re: minor ARC casting question
Re: minor ARC casting question
- Subject: Re: minor ARC casting question
- From: Matt Neuburg <email@hidden>
- Date: Wed, 02 Nov 2011 08:43:45 -0700
On Nov 2, 2011, at 4:31 AM, Igor Mozolevsky wrote:
> the compiler has
> no clue what you intend to do with `ref' of type `CGImageRef'. What
> bridging does is it tells the compiler to stop worrying because _you_
> have taken over the management of the type
You're focussing on the wrong part of my question. I understand perfectly why I have to cast to __bridge id. I *like* casting to __bridge id.
What I wasn't understanding is why I *didn't* have to cast to __bridge id in the first two cases I listed. And, since Apple's own example, with no casting, does not compile, I was left with *no* official documentation as to what I should do in those cases. I discovered by experimentation that I could get away with casting to id alone, and I was concerned with whether that was a correct solution. Now I've been told that it is. I thought it probably was, and I thought I could probably guess why, but I wanted to check. Now I have.
> Are you saying that because someone at Apple was being sloppy in
> writing that sample code and, as it transpires, hasn't fixed that
> mis-type yet, the document is invalidated as a whole?
No. I was not saying anything about validity of anything. I was asking about the specific cases I'm asking about. You're the one who keeps elevating it to some sort of global warfare. Rather unhelpfully, I might add. m.
--
matt neuburg, phd = email@hidden, http://www.apeth.net/matt/
pantes anthropoi tou eidenai oregontai phusei
Among the 2007 MacTech Top 25, http://tinyurl.com/2rh4pf
Programming iOS 4! http://www.apeth.net/matt/default.html#iosbook
RubyFrontier! http://www.apeth.com/RubyFrontierDocs/default.html
TidBITS, Mac news and reviews since 1990, http://www.tidbits.com
_______________________________________________
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