Reputation: 23
I'm getting into mobile app development and have been recently looking into mobile games. I stumbled across a Github Repo (Here). It's a game built using SpriteKit which I'm trying to learn.
I tried to build and run it using Xcode 6.0.1 on an iPhone running iOS 7, and it crashed. It runs fine on devices running iOS 8. I added a breakpoint exception to try determine the cause of the crash and here is what I got:
2014-09-25 14:23:35.813 spritybird[4470:60b] -[Scene delegate]: unrecognized selector sent to instance 0x175de140
(lldb)
It seems to break on line 61 of the Scene.m file.
if([self.delegate respondsToSelector:@selector(eventStart)]){ // This is line 61
[self.delegate eventStart];
}
I can't seem to understand what is causing it to crash on iOS 7 only.
Any help would be great! Thanks.
Upvotes: 2
Views: 388
Reputation: 17378
As Scene is most likely an SKScene
subclass it doesn't acquire the delegate
property (which is an instance of SKSceneDelegate
till iOS8
So the code is wrong.
To fix at that point
if([self respondsToSelector:@selector(delegate)]){
if([self.delegate respondsToSelector:@selector(eventStart)]){
[self.delegate eventStart];
}
}
But really you want to dig into the code and work where Scene
comes from and its inheritance to be sure as eventStart
doesn't seem to be a SpriteKit
framework symbol. Im guessing theres a bit of customisation of the delegate protocol too.
Upvotes: 2