【发布时间】:2013-03-25 07:37:56
【问题描述】:
我在 OSX Mountain Lion 10.8.3 上使用 Xcode 4.6.1
今天早上,我已将源代码从我的 macbook air 转移到我的 iMac。
现在,每次我尝试修改源代码时,XCode 都会崩溃!
例如,如果我开始写这样的东西: [ [ 任何类
XCode 将崩溃并显示此消息:无法添加具有相同标识符的另一个用户 sn-p,您只能覆盖系统 sn-ps。
但如果我之前在文本编辑器中编写代码,然后将其粘贴到 XCode 中,它可以工作!
我不明白...我已经清空了我的派生数据,清理了我的项目,清空了 /var/folders 目录,重新启动了我的 iMac ...
非常感谢您的帮助!
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Application Specific Information:
ProductBuildVersion: 4H512
ASSERTION FAILURE in /SourceCache/IDECodeSnippetLibrary/IDECodeSnippetLibrary-2055/Source/IDECodeSnippetRepository.m:320
Details: Cannot add another user snippet with the same identifier, you can only override system snippets.
Object: <IDECodeSnippetRepository: 0x4050a98c0>
Method: -addCodeSnippet:
Thread: <NSThread: 0x40030a220>{name = (null), num = 1}
Hints: None
Backtrace:
0 0x000000010b681a2a -[IDEAssertionHandler handleFailureInMethod:object:fileName:lineNumber:messageFormat:arguments:] (in IDEKit)
1 0x000000010a9255f4 _DVTAssertionFailureHandler (in DVTFoundation)
2 0x000000010f40f975 -[IDECodeSnippetRepository addCodeSnippet:] (in IDECodeSnippetLibrary)
3 0x000000010f40fcfb -[IDECodeSnippetRepository _loadUserCodeSnippets] (in IDECodeSnippetLibrary)
4 0x000000010f40ee63 -[IDECodeSnippetRepository init] (in IDECodeSnippetLibrary)
5 0x000000010f4150c4 __44+[IDECodeSnippetRepository sharedRepository]_block_invoke (in IDECodeSnippetLibrary)
6 0x00007fff94b950b6 _dispatch_client_callout (in libdispatch.dylib)
7 0x00007fff94b95041 dispatch_once_f (in libdispatch.dylib)
8 0x000000010f40ecaa +[IDECodeSnippetRepository sharedRepository] (in IDECodeSnippetLibrary)
9 0x000000010f416cbe __102+[IDECodeSnippetLibraryCompletionStrategy _generateCompletionsForScopes:language:platformNames:atBOL:]_block_invoke (in IDECodeSnippetLibrary)
【问题讨论】:
-
听起来可能与 Xcode 代码 sn-ps 有关。尝试删除
~/Library/Developer/Xcode/UserData/CodeSnippets的文件 -
@Matthias,你是对的!这是因为 DropBox 在我的 sn-ps 文件夹中检测到一些冲突。在这种情况下,Dropbox 会制作一个扩展名为 .conflict 但名称相同的文件的副本。而且,对于 XCode,似乎 2 个 sn-ps 具有相同的名称。非常感谢您的帮助!