stig/json-framework — Issue #108: ARC issue with toll-free bridge cast from NSMutableString* to CFMutableStringRef
Author: tinneyu
Created: 2011-11-09 12:18:57+00:00
State: open

Hi, i am using Xcode 4 with ARC. it gives me error when i compile the project, despite all the release/autorelease/retain issues, I had another issue which I cant find an answer not even in the apple developer site.

1. Error message: "Cast of Objective-C pointer type 'NSMutableString *' to C pointer type 'CFMutableStringRef' (aka 'struct __CFString *') requires a bridged cast:"
On statement:
CFStringAppendCharacters((CFMutableStringRef)json, &uc, 1);

2. Error message: "Cast of Objective-C pointer type 'NSMutableString *' to C pointer type 'CFMutableStringRef' (aka 'struct __CFString *') requires a bridged cast"
On statement:
CFStringAppendCharacters((CFMutableStringRef)*o, &uc, 1);

I checked on the official developer site and it was said that the CFMutableString and NSMutableString is toll-free bridging. Instead in compile time it gives me errors. I tried as xcode recommended casting them using __bridge to convert directly. However, this gives me EXC_BAD_ACCESS error.

Can anyone help me with this? Thanks in advance.

Tinne