【发布时间】:2013-10-01 08:07:59
【问题描述】:
我已升级到 Xcode 5.0。当我在调试模式下运行应用程序并尝试在控制台中打印 NSString 值时,它给了我以下错误。有什么想法吗?
error: warning: couldn't get cmd pointer (substituting NULL): Couldn't load '_cmd' because its value couldn't be evaluated
Couldn't materialize struct: the variable 'stringValue' has no location, it may have been optimized out
Errored out in Execute, couldn't PrepareToExecuteJITExpression
代码如下:
NSString *stringValue = [[self.responseArray objectAtIndex:i] valueForKey:@"merchant_name"];
【问题讨论】:
-
你能展示你正在调试的代码吗?
-
NSString *stringValue = [[self.responseArray objectAtIndex:i] valueForKey:@"merchant_name"];当我尝试打印 po stringValue 时,它给了我上述错误
-
什么是“i”计数器?您确定您的 dic 中有“merchant_name”吗?尝试一些调试。
-
是的,我确实尝试过,并且 NSString 已经获得了价值。它只是没有在控制台中显示值
-
用
objectForKey代替valueForKey,你能给我们:NSLog(@"%@", _responseArray);好吗?
标签: ios objective-c