运行Objective-C项目时,Xcode崩溃了

时间:2013-04-08 15:06:51

标签: objective-c xcode macos

我正在运行Xcode 4.6.1,使用最新的SDK,我可以很好地构建项目,但是当我尝试运行它时,它会崩溃。

这是崩溃报告的开始。

Process:         Xcode [13573]
Path:            /Applications/Xcode.app/Contents/MacOS/Xcode
Identifier:      com.apple.dt.Xcode
Version:         4.6.1 (2067)
Build Info:      IDEApplication-2067000000000000~2
App Item ID:     497799835
App External ID: 14581035
Code Type:       X86-64 (Native)
Parent Process:  launchd [278]
User ID:         501

Date/Time:       2013-04-08 17:57:47.633 +0300
OS Version:      Mac OS X 10.8.3 (12D78)
Report Version:  10

Interval Since Last Report:          39613 sec
Crashes Since Last Report:           3
Per-App Interval Since Last Report:  1751 sec
Per-App Crashes Since Last Report:   2
Anonymous UUID:                      DC5CB8D0-2A9C-75E6-5631-42D5362B172F

Crashed Thread:  0  Dispatch queue: com.apple.main-thread

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000

Application Specific Information:
ProductBuildVersion: 4H512
UNCAUGHT EXCEPTION (NSInvalidArgumentException): -[__NSCFString alloc]: unrecognized selector sent to instance 0x4009ce3e0
UserInfo: (null)
Hints: None
Backtrace:
  0  0x00007fff8ea76aee __exceptionPreprocess (in CoreFoundation)
  1  0x00007fff867863f0 objc_exception_throw (in libobjc.A.dylib)
  2  0x00007fff8eb0d40a -[NSObject(NSObject) doesNotRecognizeSelector:] (in Core Foundation)

正在构建和编译的代码来自Xcode中命令行工具的模板

#import <Foundation/Foundation.h>

int main(int argc, const char * argv[])
{

    @autoreleasepool {

        // insert code here...
        NSLog(@"Hello, World!");

    }
    return 0;
}

1 个答案:

答案 0 :(得分:3)

这似乎是Xcode的破坏安装和/或系统坏了。

如果你可以打开/建立/运行其他项目,我会感到惊讶。如果是这样,则可能是派生数据文件夹是双层的情况。尝试删除~/Library/Developer/Xcode/DerivedData(假设您已将其保留在默认位置。

另外,查看Console.app并查看是否有任何令人不安的消息。