环顾四周,我找不到任何令人满意的答案来解决我的特定问题。在 SO 上找到了一些关于此错误代码的帖子,但他们主要讨论的是编译器在点符号和未分配标签方面存在问题,因此这些问题似乎不适用于此处。
在我的 HelloWorldLayer.m 文件中,我有一个方法可以将 CCSprites 添加到图层并将它们移动到屏幕上的某些位置。该方法工作正常——精灵被正确初始化和动画——当我移动每个精灵并单独设置我的 BOOL 时,如下所示:
[card1 moveToCard1Position];
[opponentCard1 moveToOpponentCard1Position];
[card2 moveToCard2Position];
[opponentCard2 moveToOpponentCard2Position];
[CCDelayTime actionWithDuration: kHoleCardTravelTime];
// BOOLs to determine if the card is in its proper place
card1ReachedPosition = YES;
card2ReachedPosition = YES;
opponentCard1ReachedPosition = YES;
opponentCard2ReachedPosition = YES;
但是我需要在动画真正实时完成之前不要设置布尔值。因此,当我使用 CCSequence 将布尔值的设置延迟为 YES 时,直到动画完成后,如下所示:
[self runAction:[CCSequence actions:[CCDelayTime actionWithDuration:0.0],
[card1 moveToCard1Position],
[opponentCard1 moveToOpponentCard1Position],
[card2 moveToHoleCard2Position],
[opponentCard2 moveToOpponentCard2Position],
[CCDelayTime actionWithDuration:kCardTravelTime],
card1ReachedPosition = YES,
card2ReachedPosition = YES,
opponentCard1ReachedPosition = YES,
opponentCard2ReachedPosition = YES,
nil]];
我收到“clang 失败,退出代码 254”错误。完整的错误,为了彻底,我将在底部显示。我在 HelloWorldLayer.m 文件中的其他地方使用了 [self runAction:...] 就好了,但由于某种我无法弄清楚的原因,只有这种方法会引发 254 错误。我做错了什么?TIA
CompileC /Users/Home/Library/Developer/Xcode/DerivedData/CardGame-efaqdicwgomjmmefmvhiyaissfgj/Build/Intermediates/CardGame.build/Debug-iphonesimulator/CardGame.build/Objects-normal/i386/HelloWorldLayer.o CardGame/HelloWorldLayer.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler
cd /Users/Home/Development/zzzMyGames/CardGame
setenv LANG en_US.US-ASCII
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c -arch i386 -fmessage-length=0 -std=gnu99 -Wno-trigraphs -fpascal-strings -O0 -Wno-missing-field-initializers -Wno-missing-prototypes -Wreturn-type -Wno-implicit-atomic-properties -Wformat -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wno-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-sign-compare -Wno-shorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wno-undeclared-selector -Wno-deprecated-implementations -DDEBUG -DCOCOS2D_DEBUG=1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk -fexceptions -fasm-blocks -Wprotocol -Wdeprecated-declarations -mmacosx-version-min=10.6 -g -Wno-conversion -Wno-sign-conversion -fobjc-abi-version=2 -fobjc-legacy-dispatch "-DIBOutlet=__attribute__((iboutlet))" "-DIBOutletCollection(ClassName)=__attribute__((iboutletcollection(ClassName)))" "-DIBAction=void)__attribute__((ibaction)" -D__IPHONE_OS_VERSION_MIN_REQUIRED=50100 -iquote /Users/Home/Library/Developer/Xcode/DerivedData/CardGame-efaqdicwgomjmmefmvhiyaissfgj/Build/Intermediates/CardGame.build/Debug-iphonesimulator/CardGame.build/CardGame-generated-files.hmap -I/Users/Home/Library/Developer/Xcode/DerivedData/CardGame-efaqdicwgomjmmefmvhiyaissfgj/Build/Intermediates/CardGame.build/Debug-iphonesimulator/CardGame.build/CardGame-own-target-headers.hmap -I/Users/Home/Library/Developer/Xcode/DerivedData/CardGame-efaqdicwgomjmmefmvhiyaissfgj/Build/Intermediates/CardGame.build/Debug-iphonesimulator/CardGame.build/CardGame-all-target-headers.hmap -iquote /Users/Home/Library/Developer/Xcode/DerivedData/CardGame-efaqdicwgomjmmefmvhiyaissfgj/Build/Intermediates/CardGame.build/Debug-iphonesimulator/CardGame.build/CardGame-project-headers.hmap -I/Users/Home/Library/Developer/Xcode/DerivedData/CardGame-efaqdicwgomjmmefmvhiyaissfgj/Build/Products/Debug-iphonesimulator/include -ICardGame/libs/kazmath/include -I/Users/Home/Library/Developer/Xcode/DerivedData/CardGame-efaqdicwgomjmmefmvhiyaissfgj/Build/Intermediates/CardGame.build/Debug-iphonesimulator/CardGame.build/DerivedSources/i386 -I/Users/Home/Library/Developer/Xcode/DerivedData/CardGame-efaqdicwgomjmmefmvhiyaissfgj/Build/Intermediates/CardGame.build/Debug-iphonesimulator/CardGame.build/DerivedSources -F/Users/Home/Library/Developer/Xcode/DerivedData/CardGame-efaqdicwgomjmmefmvhiyaissfgj/Build/Products/Debug-iphonesimulator -include /Users/Home/Library/Developer/Xcode/DerivedData/CardGame-efaqdicwgomjmmefmvhiyaissfgj/Build/Intermediates/PrecompiledHeaders/Prefix-ggqxnfadbzynyrexiqnutryhfhfk/Prefix.pch -MMD -MT dependencies -MF /Users/Home/Library/Developer/Xcode/DerivedData/CardGame-efaqdicwgomjmmefmvhiyaissfgj/Build/Intermediates/CardGame.build/Debug-iphonesimulator/CardGame.build/Objects-normal/i386/HelloWorldLayer.d --serialize-diagnostics /Users/Home/Library/Developer/Xcode/DerivedData/CardGame-efaqdicwgomjmmefmvhiyaissfgj/Build/Intermediates/CardGame.build/Debug-iphonesimulator/CardGame.build/Objects-normal/i386/HelloWorldLayer.dia -c /Users/Home/Development/zzzMyGames/CardGame/CardGame/HelloWorldLayer.m -o /Users/Home/Library/Developer/Xcode/DerivedData/CardGame-efaqdicwgomjmmefmvhiyaissfgj/Build/Intermediates/CardGame.build/Debug-iphonesimulator/CardGame.build/Objects-normal/i386/HelloWorldLayer.o
0 clang 0x000000010149e422 _ZL15PrintStackTracePv + 34
1 clang 0x000000010149e8a9 _ZL13SignalHandleri + 553
2 libsystem_c.dylib 0x00007fff95754cfa _sigtramp + 26
3 libsystem_c.dylib 0x00007fff60172000 _sigtramp + 18446744072814187296
4 clang 0x0000000100d85de9 (anonymous namespace)::CGObjCCommonMac::EmitMessageSend(clang::CodeGen::CodeGenFunction&, clang::CodeGen::ReturnValueSlot, clang::QualType, llvm::Value*, llvm::Value*, clang::QualType, bool, clang::CodeGen::CallArgList const&, clang::ObjCMethodDecl const*, (anonymous namespace)::ObjCCommonTypesHelper const&) + 1385
5 clang 0x0000000100d88525 (anonymous namespace)::CGObjCNonFragileABIMac::GenerateMessageSend(clang::CodeGen::CodeGenFunction&, clang::CodeGen::ReturnValueSlot, clang::QualType, clang::Selector, llvm::Value*, clang::CodeGen::CallArgList const&, clang::ObjCInterfaceDecl const*, clang::ObjCMethodDecl const*) + 309
6 clang 0x0000000100d64074 clang::CodeGen::CodeGenFunction::EmitObjCMessageExpr(clang::ObjCMessageExpr const*, clang::CodeGen::ReturnValueSlot) + 1908
7 clang 0x00000001007110a5 clang::StmtVisitorBase<clang::make_ptr, (anonymous namespace)::ScalarExprEmitter, llvm::Value*>::Visit(clang::Stmt*) + 17349
8 clang 0x00000001008ec760 (anonymous namespace)::ScalarExprEmitter::VisitCastExpr(clang::CastExpr*) + 464
9 clang 0x000000010070fabb clang::StmtVisitorBase<clang::make_ptr, (anonymous namespace)::ScalarExprEmitter, llvm::Value*>::Visit(clang::Stmt*) + 11739
10 clang 0x000000010070ccc8 clang::CodeGen::CodeGenFunction::EmitScalarExpr(clang::Expr const*, bool) + 72
11 clang 0x00000001008ee819 clang::CodeGen::CodeGenFunction::EmitAnyExpr(clang::Expr const*, clang::CodeGen::AggValueSlot, bool) + 57
12 clang 0x00000001008ee715 clang::CodeGen::CodeGenFunction::EmitCallArg(clang::CodeGen::CallArgList&, clang::Expr const*, clang::QualType) + 1445
13 clang 0x0000000100d6b011 void clang::CodeGen::CodeGenFunction::EmitCallArgs<clang::ObjCMethodDecl>(clang::CodeGen::CallArgList&, clang::ObjCMethodDecl const*, clang::ConstExprIterator, clang::ConstExprIterator) + 97
14 clang 0x0000000100d63e78 clang::CodeGen::CodeGenFunction::EmitObjCMessageExpr(clang::ObjCMessageExpr const*, clang::CodeGen::ReturnValueSlot) + 1400
15 clang 0x00000001007110a5 clang::StmtVisitorBase<clang::make_ptr, (anonymous namespace)::ScalarExprEmitter, llvm::Value*>::Visit(clang::Stmt*) + 17349
16 clang 0x000000010070ccc8 clang::CodeGen::CodeGenFunction::EmitScalarExpr(clang::Expr const*, bool) + 72
17 clang 0x00000001008ee819 clang::CodeGen::CodeGenFunction::EmitAnyExpr(clang::Expr const*, clang::CodeGen::AggValueSlot, bool) + 57
18 clang 0x00000001008f1e09 clang::CodeGen::CodeGenFunction::EmitIgnoredExpr(clang::Expr const*) + 41
19 clang 0x000000010070c312 clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*) + 242
20 clang 0x000000010070c8eb clang::CodeGen::CodeGenFunction::EmitCompoundStmt(clang::CompoundStmt const&, bool, clang::CodeGen::AggValueSlot) + 251
21 clang 0x000000010070c69a clang::CodeGen::CodeGenFunction::EmitSimpleStmt(clang::Stmt const*) + 154
22 clang 0x000000010070c240 clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*) + 32
23 clang 0x0000000100d651ba clang::CodeGen::CodeGenFunction::GenerateObjCMethod(clang::ObjCMethodDecl const*) + 58
24 clang 0x000000010061b07c clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) + 876
25 clang 0x000000010061acef (anonymous namespace)::CodeGeneratorImpl::HandleTopLevelDecl(clang::DeclGroupRef) + 95
26 clang 0x000000010061ac51 clang::BackendConsumer::HandleTopLevelDecl(clang::DeclGroupRef) + 161
27 clang 0x00000001005e3092 clang::ParseAST(clang::Sema&, bool) + 306
28 clang 0x00000001005e1bd7 clang::CodeGenAction::ExecuteAction() + 855
29 clang 0x00000001005b413f clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 879
30 clang 0x00000001005b2dcb clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 2683
31 clang 0x00000001005a55ce cc1_main(char const**, char const**, char const*, void*) + 5086
32 clang 0x000000010057fdd8 main + 648
33 clang 0x000000010057fb44 start + 52
Stack dump:
0. Program arguments: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -cc1 -triple i386-apple-macosx10.6.0 -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name HelloWorldLayer.m -pic-level 1 -mdisable-fp-elim -relaxed-aliasing -masm-verbose -target-cpu yonah -target-linker-version 128.2 -g -coverage-file /Users/Home/Library/Developer/Xcode/DerivedData/CardGame-efaqdicwgomjmmefmvhiyaissfgj/Build/Intermediates/CardGame.build/Debug-iphonesimulator/CardGame.build/Objects-normal/i386/HelloWorldLayer.o -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/3.1 -dependency-file /Users/Home/Library/Developer/Xcode/DerivedData/CardGame-efaqdicwgomjmmefmvhiyaissfgj/Build/Intermediates/CardGame.build/Debug-iphonesimulator/CardGame.build/Objects-normal/i386/HelloWorldLayer.d -MT dependencies -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk -iquote /Users/Home/Library/Developer/Xcode/DerivedData/CardGame-efaqdicwgomjmmefmvhiyaissfgj/Build/Intermediates/CardGame.build/Debug-iphonesimulator/CardGame.build/CardGame-generated-files.hmap -iquote /Users/Home/Library/Developer/Xcode/DerivedData/CardGame-efaqdicwgomjmmefmvhiyaissfgj/Build/Intermediates/CardGame.build/Debug-iphonesimulator/CardGame.build/CardGame-project-headers.hmap -include-pch /Users/Home/Library/Developer/Xcode/DerivedData/CardGame-efaqdicwgomjmmefmvhiyaissfgj/Build/Intermediates/PrecompiledHeaders/Prefix-ggqxnfadbzynyrexiqnutryhfhfk/Prefix.pch.pth -D DEBUG -D COCOS2D_DEBUG=1 -D IBOutlet=__attribute__((iboutlet)) -D IBOutletCollection(ClassName)=__attribute__((iboutletcollection(ClassName))) -D IBAction=void)__attribute__((ibaction) -D __IPHONE_OS_VERSION_MIN_REQUIRED=50100 -I /Users/Home/Library/Developer/Xcode/DerivedData/CardGame-efaqdicwgomjmmefmvhiyaissfgj/Build/Intermediates/CardGame.build/Debug-iphonesimulator/CardGame.build/CardGame-own-target-headers.hmap -I /Users/Home/Library/Developer/Xcode/DerivedData/CardGame-efaqdicwgomjmmefmvhiyaissfgj/Build/Intermediates/CardGame.build/Debug-iphonesimulator/CardGame.build/CardGame-all-target-headers.hmap -I /Users/Home/Library/Developer/Xcode/DerivedData/CardGame-efaqdicwgomjmmefmvhiyaissfgj/Build/Products/Debug-iphonesimulator/include -I CardGame/libs/kazmath/include -I /Users/Home/Library/Developer/Xcode/DerivedData/CardGame-efaqdicwgomjmmefmvhiyaissfgj/Build/Intermediates/CardGame.build/Debug-iphonesimulator/CardGame.build/DerivedSources/i386 -I /Users/Home/Library/Developer/Xcode/DerivedData/CardGame-efaqdicwgomjmmefmvhiyaissfgj/Build/Intermediates/CardGame.build/Debug-iphonesimulator/CardGame.build/DerivedSources -F/Users/Home/Library/Developer/Xcode/DerivedData/CardGame-efaqdicwgomjmmefmvhiyaissfgj/Build/Products/Debug-iphonesimulator -fmodule-cache-path /var/folders/gl/wnr8s5t94vqfqf9s9bthyb200000gp/T/clang-module-cache -O0 -Wno-trigraphs -Wno-missing-field-initializers -Wno-missing-prototypes -Wreturn-type -Wno-implicit-atomic-properties -Wformat -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wno-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-sign-compare -Wno-shorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wno-undeclared-selector -Wno-deprecated-implementations -Wprotocol -Wdeprecated-declarations -Wno-conversion -Wno-sign-conversion -std=gnu99 -ferror-limit 19 -fmessage-length 0 -stack-protector 1 -fblocks -fobjc-runtime-has-arc -fobjc-runtime-has-weak -fobjc-exceptions -fexceptions -fpascal-strings -fdiagnostics-show-option -serialize-diagnostic-file /Users/Home/Library/Developer/Xcode/DerivedData/CardGame-efaqdicwgomjmmefmvhiyaissfgj/Build/Intermediates/CardGame.build/Debug-iphonesimulator/CardGame.build/Objects-normal/i386/HelloWorldLayer.dia -o /Users/Home/Library/Developer/Xcode/DerivedData/CardGame-efaqdicwgomjmmefmvhiyaissfgj/Build/Intermediates/CardGame.build/Debug-iphonesimulator/CardGame.build/Objects-normal/i386/HelloWorldLayer.o -x objective-c /Users/Home/Development/zzzMyGames/CardGame/CardGame/HelloWorldLayer.m
1. <eof> parser at end of file
2. /Users/Home/Development/zzzMyGames/CardGame/CardGame/HelloWorldLayer.m:52:1: LLVM IR generation of declaration 'HelloWorldLayer::scene'
3. /Users/Home/Development/zzzMyGames/CardGame/CardGame/HelloWorldLayer.m:339:22: LLVM IR generation of compound statement ('{}')
clang: error: unable to execute command: Segmentation fault: 11
clang: error: clang frontend command failed due to signal 2 (use -v to see invocation)
clang: note: diagnostic msg: Please submit a bug report to http://developer.apple.com/bugreporter/ and include command line arguments and all diagnostic information.
clang: note: diagnostic msg: Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /var/folders/gl/wnr8s5t94vqfqf9s9bthyb200000gp/T/HelloWorldLayer-GbrnJj.mi
clang: note: diagnostic msg: /var/folders/gl/wnr8s5t94vqfqf9s9bthyb200000gp/T/HelloWorldLayer-GbrnJj.sh
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 254