在以下代码中调用[obj JSONString]
方法时,我一直在运行EXC_BAD_ACCESS,我不知道为什么。我试过打开Zombie Objects,但没有任何不同的事情发生。
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
NSDictionary *obj = @{
@"id": @1,
@"date": @"11/07/2012",
@"companyInfo": @"Company Details",
@"customerInfo": @"Customer Details",
@"taxRate": @0
};
NSLog(@"%@", obj);
NSLog(@"%@", [obj JSONString]);
// Other stuff here
}
我在经营狮子。我刚刚升级到Xcode 4.4并使用CocoaPods 0.9.2来安装JSONKit。我已经尝试过JSONKit的1.4
和1.5pre
版本都无济于事。
我正在使用最新的OS X SDK(10.8),部署目标为10.6(必须部署到10.6)。我也尝试了10.7 SDK但结果是一样的。 10.6 SDK不再可用,所以我无法测试。
clang --version
显示:
Apple clang version 3.1 (tags/Apple/clang-318.0.61) (based on LLVM 3.1svn)
Target: x86_64-apple-darwin11.4.0
Thread model: posix
当我使用Xcode 4.3时,应用程序已正确编译并运行。
答案 0 :(得分:0)
原来,问题是CocoaPods在运行pod install
时没有删除现有的JSONKit文件。我正在使用版本1.5pre
并且代码正确执行。