2011-12-03 10 views
0

私はcocos2d 1.01を使用しており、このパッチをCCGestureRecognizerに適用しました。https://github.com/xemus/cocos2d-GestureRecognizers/archives/master以下は私のコードです:issue with ccGestureRecognizer

CCGestureRecognizer *recognizer; 
UITapGestureRecognizer *tapGesture = [[[UITapGestureRecognizer alloc]init] autorelease]; 
recognizer = [CCGestureRecognizer CCRecognizerWithRecognizerTargetAction:tapGesture 
target:self action:@selector(tapGesture:node:)]; 
[self addGestureRecognizer:recognizer]; 

と私は下になります。

Ld /Users/macbook/Library/Developer/Xcode/DerivedData/dfaas-eqrkiqwuooxmcphhvbaoxxodahie/Build/Products/Debug-iphonesimulator/dfaas.app/dfaas normal i386 
    cd /Users/macbook/Desktop/C_program/dfaas 
    setenv MACOSX_DEPLOYMENT_TARGET 10.6 
    setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" 
    /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/llvm-g++-4.2 -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk -L/Users/macbook/Library/Developer/Xcode/DerivedData/dfaas-eqrkiqwuooxmcphhvbaoxxodahie/Build/Products/Debug-iphonesimulator -F/Users/macbook/Library/Developer/Xcode/DerivedData/dfaas-eqrkiqwuooxmcphhvbaoxxodahie/Build/Products/Debug-iphonesimulator -filelist /Users/macbook/Library/Developer/Xcode/DerivedData/dfaas-eqrkiqwuooxmcphhvbaoxxodahie/Build/Intermediates/dfaas.build/Debug-iphonesimulator/dfaas.build/Objects-normal/i386/dfaas.LinkFileList -mmacosx-version-min=10.6 -lz -Xlinker -objc_abi_version -Xlinker 2 -framework QuartzCore -framework OpenGLES -framework OpenAL -framework AudioToolbox -framework AVFoundation -framework UIKit -framework Foundation -framework CoreGraphics -o /Users/macbook/Library/Developer/Xcode/DerivedData/dfaas-eqrkiqwuooxmcphhvbaoxxodahie/Build/Products/Debug-iphonesimulator/dfaas.app/dfaas 

Undefined symbols for architecture i386: 
    "_OBJC_CLASS_$_CCGestureRecognizer", referenced from: 
     objc-class-ref in test.o 
ld: symbol(s) not found for architecture i386 
collect2: ld returned 1 exit status 

答えて

0

これは、CCGestureRecognizerがあなたのアプリにリンクされていないことを意味します。コードを見ると、そのリポジトリにはCCGestureRecognizerという名前のクラスは存在しません。このクラスはこのpatch fileにしかありません。したがって、パッチを適用するか、UIGestureRecognizerを直接使用するだけです(実際には使いやすく、well documented)。

Btw,Kobold2Dgesture recognition already built-inである。 UIGestureRecognizerクラスよりも使い易くなっています。