Bes*_*esi 3 iphone xcode gdb objective-c ios
我最近在Xcode中发现了GDB,它弥补了IMHO在Xcode中似乎缺乏的一些功能.
所以我可以在GDB中执行以下操作:
(gdb) po [LoginManager sharedSession].loginToken
20D52FE9-3573-437E-9A65-846572B63726
Run Code Online (Sandbox Code Playgroud)
但是,我有另一个Service类,当前没有加载,所以我收到以下错误:
(gdb) po [SessionService displaySessionInfoForToken:@"XXX"]
No symbol "SessionService" in current context.
Run Code Online (Sandbox Code Playgroud)
我不明白为什么LoginManager
可以加载而不是SessionService
.
尝试使用NSClassFromString,如下所示:
(gdb) po [NSClassFromString(@"SessionService") displaySessionInfoForToken:@"XXX"]
Run Code Online (Sandbox Code Playgroud)
很难确切地说出发生了什么,但是使用NSClassFromString可能会在运行时中发出正确的事情来做你想做的事情.
归档时间: |
|
查看次数: |
363 次 |
最近记录: |