m (Array comprehension. Removing excessively long output.) |
No edit summary |
||
Line 15: | Line 15: | ||
cy# [i for (i in *UIApp)] | cy# [i for (i in *UIApp)] | ||
["isa","_delegate","_touchMap","_exclusiveTouchWindows","_event",... | ["isa","_delegate","_touchMap","_exclusiveTouchWindows","_event",... | ||
</source> | |||
You may use this function to get as much ivar values as possible: | |||
<source lang="javascript"> | |||
function tryPrintIvars(a){ var x={}; for(i in *a){ try{ x[i] = (*a)[i]; } catch(e){} } return x; } | |||
</source> | |||
To use: | |||
<source lang="javascript"> | |||
cy# *a | |||
{message:"hasProperty callback returned true for a property that doesn't exist.",name:"ReferenceError"} | |||
cy# tryPrintIvars(a) | |||
{isa:"SBWaveView",_layer:"<CALayer: 0x2a5160>",_tapInfo:null,_gestureInfo:null,_gestureRecognizers:... | |||
</source> | </source> |
Revision as of 18:14, 2 November 2009
Printing Ivars
Often just typing *varName works:
cy# *controller
{isa:"PrefsRootController",_contentView:"<UIView: 0x10bd70; frame = (0 0; 320 460); autoresize = W+H; layer = <CALayer: 0x150120>>",_navBar:...
cy#
Sometimes it does not...
cy# *UIApp
{message:"hasProperty callback returned true for a property that doesn't exist.",name:"ReferenceError"}
then you can do:
cy# [i for (i in *UIApp)]
["isa","_delegate","_touchMap","_exclusiveTouchWindows","_event",...
You may use this function to get as much ivar values as possible:
function tryPrintIvars(a){ var x={}; for(i in *a){ try{ x[i] = (*a)[i]; } catch(e){} } return x; }
To use:
cy# *a
{message:"hasProperty callback returned true for a property that doesn't exist.",name:"ReferenceError"}
cy# tryPrintIvars(a)
{isa:"SBWaveView",_layer:"<CALayer: 0x2a5160>",_tapInfo:null,_gestureInfo:null,_gestureRecognizers:...