从Xcode Debugger调用方法? [英] Calling methods from Xcode Debugger?

查看:91
本文介绍了从Xcode Debugger调用方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从Xcode调试器命令行调用方法的正确方法是什么?



例如,如果我位于类A的sort:方法中(使用调试器),我怎么也可以调用属于类A的debugSort:方法呢?



(我的代码是Objective-C btw)

解决方案

< blockquote>
要在gdb控制台中调用Objective-C方法,必须强制转换返回类型(因为gdb并不真正知道返回值是什么):




(gdb)调用(void)[textField setStringValue:@ Bork]


gdb的快速工具


what's the correct way to call a method from the Xcode debugger command line ?

For example if I'm inside the sort: method of my class A (using the debugger), how can I call debugSort: method that belongs to class A too ?

( My code is Objective-C btw )

解决方案

To call an Objective-C method in the gdb console, you have to cast the return type (since gdb doesn't really know what the return value is):

(gdb) call (void)[textField setStringValue: @"Bork"]

Quickies for gdb

这篇关于从Xcode Debugger调用方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆