error on line 1987

I am having a bit of a play with the cocos2d game engine for iPhone and encountered a very strange error in the console – I don’t believe it’s at all related to the game engine itself, so it’s just coincidence that I was trying something new out.

error while killing target (killing anyway): warning: error on line 1987 of “/SourceCache/gdb/gdb-962/src/gdb/macosx/macosx-nat-inferior.c” in function “macosx_kill_inferior_safe”: (os/kern) failure (0×5x)

I figured out that it had to do with definition of a selector… Naughty code below.

MenuItem *start = [MenuItemFont itemFromString:@"Start Game"
                                        target:self
                                      selector:@selector(startGame)];

The problem is that the method name inside @selector() MUST have a colon on the back of it.

Good code

MenuItem *start = [MenuItemFont itemFromString:@"Start Game"
                                        target:self
                                      selector:@selector(startGame:)];

Hope that’s useful to someone.

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Furl
  • NewsVine
  • Reddit
  • StumbleUpon
  • Technorati
  • Pownce
  • Sphinn
  • Spurl
  • TailRank
  • LinkedIn
  • MySpace
blog comments powered by Disqus