Thr*_*dyn 2 iphone xcode objective-c cocos2d-iphone
Xcode 3.2.5,iOS 4.2(模拟器),Cocos2D 0.99.5
在本教程之后会出现一个精彩的崩溃,如下所示.
我没有通过谷歌在任何网站上找到一个(直接)相关的东西.我得到的最接近的是这个网站上的其他东西有相同的错误,但完全不同的原因.(无论如何,我假设如此.但是,鉴于0.99.5带有两个Analyzer结果,它可能只是一个糟糕的版本...)
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[NSInvocation invocationWithMethodSignature:]: method signature argument cannot be nil'
*** Call stack at first throw:
(
0 CoreFoundation 0x013cbbe9 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x015205c2 objc_exception_throw + 47
2 CoreFoundation 0x0133bb09 +[NSInvocation invocationWithMethodSignature:] + 553
3 FirstGame 0x0005ddd4 -[CCMenuItem initWithTarget:selector:] + 308
4 FirstGame 0x0005e528 -[CCMenuItemLabel initWithLabel:target:selector:] + 104
5 FirstGame 0x0005fb1d -[CCMenuItemFont initFromString:target:selector:] + 365
6 FirstGame 0x0005f8db +[CCMenuItemFont itemFromString:target:selector:] + 123
7 FirstGame 0x00003457 -[HelloWorld init] + 231
8 FirstGame 0x00063db1 +[CCNode node] + 81
9 FirstGame 0x0000332d +[HelloWorld scene] + 93
10 FirstGame 0x00002dbc -[FirstGameAppDelegate applicationDidFinishLaunching:] + 1212
11 UIKit 0x0085a253 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1252
12 UIKit 0x0085c55e -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 439
13 UIKit 0x00866db2 -[UIApplication handleEvent:withNewEvent:] + 1533
14 UIKit 0x0085f202 -[UIApplication sendEvent:] + 71
15 UIKit 0x00864732 _UIApplicationHandleEvent + 7576
16 GraphicsServices 0x02973a36 PurpleEventCallback + 1550
17 CoreFoundation 0x013ad064 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
18 CoreFoundation 0x0130d6f7 __CFRunLoopDoSource1 + 215
19 CoreFoundation 0x0130a983 __CFRunLoopRun + 979
20 CoreFoundation 0x0130a240 CFRunLoopRunSpecific + 208
21 CoreFoundation 0x0130a161 CFRunLoopRunInMode + 97
22 UIKit 0x0085bfa8 -[UIApplication _run] + 636
23 UIKit 0x0086842e UIApplicationMain + 1160
24 FirstGame 0x000028a4 main + 100
25 FirstGame 0x00002835 start + 53
)
Run Code Online (Sandbox Code Playgroud)
我无法想出任何东西.也许其他人之前见过这个?
由于我对Objective-C中选择器的了解不足,我遇到了同样的错误.我最初使用签名实现了goToGameplay方法:
-(void)goToGameplay;
Run Code Online (Sandbox Code Playgroud)
相反,我不得不使用:
-(void)goToGameplay:(id)sender;
Run Code Online (Sandbox Code Playgroud)
这适用于电话:
@selector(goToGameplay:)
Run Code Online (Sandbox Code Playgroud)
希望我有所帮助.
具体来说,它看起来像这个电话?
CCMenuItem *Play = [CCMenuItemFont itemFromString:@"PLAY" target:self selector:@selector(goToGameplay:)];
Run Code Online (Sandbox Code Playgroud)
你已经实现了goToGameplay:你的HelloWorld班?
编写教程的方式,直到本教程后面才编写该方法.因此,如果您在中间运行教程并尝试点击该菜单项,它将如上所述崩溃.
| 归档时间: |
|
| 查看次数: |
8985 次 |
| 最近记录: |