2012-07-06 67 views
0

四處看看,我找不到任何滿意的答案,我的特定問題。在SO上發現了關於這個錯誤代碼的一些帖子,但是他們大多在談論編譯器有點符號和標籤沒有被分配的問題,所以這些問題在這裏似乎不適用。不知道這個錯誤代碼意味着什麼:「蘋果LLVM編譯器3.1錯誤」,「鐺失敗,退出代碼254」Cocos2D,Xcode 4.3.3

在我的HelloWorldLayer.m文件中,我有一個方法將CCSprites添加到圖層並將它們移動到屏幕上的某些位置。該方法工作正常 - 精靈被初始化並正確動畫 - 當我移動每個精靈和單獨設置我的布爾值將,就像這樣:

[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延遲的bool爲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]];  

我得到錯誤「退出代碼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 

回答

1

CCSequence獲取從CCAction派生的類對象的列表。顯然card1ReachedPosition不是CCAction類的實例,它是一個BOOL。從代碼很難說,但[card1 moveToCard1Position]可能不會返回一個CCAction類的實例。

你想要做什麼(除了不重嵌套方法調用)是使用CCCallFunc或CCCallBlock操作分別爲你設置布爾值以將調用轉接到moveToXXX方法。

+0

謝謝,Steffen。非常有意義。將在CCCallFunc和CCCallBlock上工作。 – baptzmoffire 2012-07-07 19:48:46

相關問題