objective c - Incompatible types casting 'NSString *' to 'CTStringRef *' -
i'm trying cast nsstring* ctstringref*
nsstring *foobar = @"foobar"; cfstringref *tmp = (__bridge_retained cfstringref*)foobar;
can error? "incompatible types casting 'nsstring *' 'ctstringref *' (aka const struct __cfstring **)with __bridge_retained cast"
i've tried __bridge , don't work either. documentation, think _retained right type need. thanks.
if closely @ error message see problem is. hint in part -
__cfstring **
notice 2 * - means trying cast pointer pointer, or in other words reference reference. ctstringref
reference, implied 'ref' part of name, don't need * in (__bridge_retained cfstringref*)
your code should read
nsstring *foobar = @"foobar"; cfstringref tmp = (__bridge_retained cfstringref)foobar;
Comments
Post a Comment