objective c - Use Xcode debugger to determine the type of objects stored in an NSArray -


how use xcode debugger (lldb or gdb) determine type of objects that's stored in nsarray?

another way in lldb use combination of lldb's data formatters - include 1 presents nsarray objects "real" arrays - , "dynamic type" facility in expr - pulls out real, opposed declared, types of objects. instance:

(lldb) expr -t -d run-target -- *array1 (nsarray) $2 = {       (__nscfconstantstring *) [0] = 0x0000000100002590 @"array1 object1"       (__nscfconstantstring *) [1] = 0x00000001000025b0 @"array1 object2"       (__nscfconstantstring *) [2] = 0x00000001000025d0 @"array1 object3" } 

the -t option turned on type printing. nsarray "synthetic child provider" presenting array indexed array of objects. works default, didn't have turn on. , dynamic type option -d decoding real type of each object. note, can make finding dynamic type default in lldb doing:

(lldb) set set target.prefer-dynamic-value run-target 

this array seems full of __nscfconstantstrings, apparently backing type constant nsstrings.


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -