【发布时间】:2013-11-28 11:12:50
【问题描述】:
我真的不知道为什么在这个特定项目上我的调试器被极度“禁用”。
例如,我想获取一个对象的信息:
(lldb) po [_model dictionaryValue]
[no Objective-C description available]
我想知道这是为什么。它使调试变得非常困难,并且仅在当前项目中。我猜我在某个时候对设置做了一些事情。它几乎在我尝试检查的任何po someObject 上。但是,可以在调试控制台左侧的窗格中看到范围内的变量。
我在 Xcode 5 上,我的项目中有 Cocoapods,它是一个单元测试目标。
有什么见解或方法可以解决这个问题吗?
更新:
为了清楚起见,部分测试用例是如何实现的:
@interface WWCGateModelTests : XCTestCase
{
WWCGate *_model;
}
@end
@implementation WWCGateModelTests
- (void)setUp
{
[super setUp];
// Put setup code here; it will be run once, before each test case.
_model = [WWCGate loadGateModelWithIdentifier: kGateName]; // defined, not nil
}
- (void)tearDown
{
[super tearDown];
NSError *error = nil;
[_model saveModelOrError:&error];
// Breakpoint here. po _model does not print the model.
// This has been possible with other projects... po error will print
// nil to the console. How is an ivar not in scope?
}
【问题讨论】:
-
po _model得到什么? -
erm...你读过这个问题吗? :-) [没有可用的 Objective-C 描述]
-
回答试图帮助你的人的好方法。我打算继续询问您在哪里拨打电话,是否在范围内,
dictionaryValue方法的返回值是多少。但我似乎太厚了,无法理解你的问题。 -
对不起,我不是故意的。但它写得很清楚会发生什么。我会用另一种方式说:通常在其他项目中有效的方法在这个项目中无效。我在范围内,因为我的断点在包含该变量的方法内停止。 po someObject 正在返回相同的东西
-
问题:你在哪里设置_model的值?
标签: objective-c xcode debugging lldb