What is __CFString?

梦想与她 提交于 2019-12-25 01:08:17

问题


I have arg1 which is an IMessage. IMessage is defined as:

struct IMessage {
    ...
    struct CFString _field2;
    ...
};

and CFString is defined as:

    struct CFString {
    void **_vptr$CFObject;
    struct __CFString *mCFRef;
    _Bool mIsMutable;
};

and __CFString is defined as:

struct __CFString;

My goal is to get a string of some sort be it NSString or CFStringRef from arg1, so how can i do it? Thanks.

Here is the error I get when I try to nslog mCFRef:

Thread 0 crashed:

#  1  0x97b41edb in _objc_msgSend + 0x0000001B (libobjc.A.dylib + 0x00005edb)
#  2  0x9610b5f2 in __CFStringAppendFormatAndArgumentsAux + 0x00000C42 (CoreFoundation + 0x0002c5f2)
#  3  0x9610a979 in __CFStringCreateWithFormatAndArgumentsAux + 0x00000069 (CoreFoundation + 0x0002b979)
#  4  0x961b3a3e in __CFLogvEx + 0x0000008E (CoreFoundation + 0x000d4a3e)
#  5  0x9415387c in _NSLogv + 0x0000008F (Foundation + 0x0009487c)
#  6  0x941537eb in _NSLog + 0x0000001B (Foundation + 0x000947eb)

回答1:


I don't know where you're getting this from, but CFStringRef is defined as struct __CFString *const, so you already have something that looks equivalent.



来源:https://stackoverflow.com/questions/5396873/what-is-cfstring

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!