Thursday, 15 May 2014

ios - CFArray created with CFCreateArray crashes when accessed -



ios - CFArray created with CFCreateArray crashes when accessed -

unsigned char _mystring[] = {0xda, 0xe5, 0x18, ..., 0x00}; cfarrayref array = cfarraycreate(null, (const void**) cfstringcreatewithbytes(null, _mystring, sizeof(_mystring), kcfstringencodingascii, false), 1, &kcftypearraycallbacks); cfshow(arr); // <-- exec_bad_access error

the debugger shows failing in

corefoundation`cfgettypeid:

output debugger

__nscfstring

(lldb)

i'm not sure memory error is, think must due passing of string in cfarraycreate().

casting homecoming value of cfstringcreatewithbytes const void ** incorrect, why it's crashing. it's not pointer pointer, it's pointer cfstring.

ios xcode osx core-foundation exc-bad-access

No comments:

Post a Comment