CFNetworking and ARC (was: ARC conversion help - CFErrorRef* and NSError**)
CFNetworking and ARC (was: ARC conversion help - CFErrorRef* and NSError**)
- Subject: CFNetworking and ARC (was: ARC conversion help - CFErrorRef* and NSError**)
- From: Rick Mann <email@hidden>
- Date: Tue, 30 Oct 2012 16:59:57 -0700
On Oct 30, 2012, at 3:15 , Roland King <email@hidden> wrote:
> how did you do it before, in non-ARC, what's the code look like? There must be a combination of CFBridgingRetain(), CFBridgingRelease() and (__bridge .. ) you can use to do what you're doing.
Before, I used explicit retain and release. But now, if I CFBridgingRetain() my NSObject as I pass it into CFSocketCreateConnectedToSocketSignature() (via CFSocketContext), then I can't CFBridgingRelease() it in my CFSocketCallBack, it can (will) get over-released, because that's called multiple times. So, obviously I can't do that.
The only place I can release it is when I CFRelease() the socket. But there's no way to release my object without compiler sleight-of-hand.
--
Rick
_______________________________________________
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