Leopard update causes run-time error

Discussion in 'Mac Programming' started by guifa, Nov 11, 2007.

  1. macrumors 6502

    When I updated to Leopard and rebuilt my app, I got the following error on launch which prevents windows that are set to be visible at launch from loading leaving me with an empty shell applicaiton running.

    2007-11-11 09:36:20.380 HangmanCocoa[1268:10b] *** +[MSHangmanGameMode readableTypes]: unrecognized selector sent to class 0xf3e0
    2007-11-11 09:36:20.381 HangmanCocoa[1268:10b] *** +[MSHangmanGameMode readableTypes]: unrecognized selector sent to class 0xf3e0
    2007-11-11 09:36:20.382 HangmanCocoa[1268:10b] *** +[MSHangmanGameMode readableTypes]: unrecognized selector sent to class 0xf3e0
    2007-11-11 09:36:20.383 HangmanCocoa[1268:10b] *** +[MSHangmanGameMode readableTypes]: unrecognized selector sent to class 0xf3e0
    Did anyone else get a similar error? I don't call readableType (explicitely, at least) anywhere in my program and from the documentation it's an Apple method. I've still not yet been able to localize the error in my code, none of my initial loading methods seem to trigger it.
  2. macrumors G4


    Have you done a clean rebuild? What Mac OS X/XCode version did you upgrade from? Have you changed any target settings?
  3. macrumors 6502

    I upgraded from the latest version of Tiger/XCode and opened the XCode project file, and just selected clean project, and then built it. So, in theory at least everything should be the same.

    I've isolated every place in my code where the MSHangmanGameMode object could be instantiated and have surrounded it in NSLogs and none of them are picking up. The method it's trying to call is an Apple-supplied method that seems more internally useful rather than something that should be called by us.
  4. macrumors G4


    Is it possible to have a play with the code? I'll take a quick look tomorrow if I have time.
  5. macrumors 68020


    NSHangmanGameMode is your NSDocument sub-class?
  6. macrumors 6502

    No... The NSDocument loads before a game an MSHangmanGameMode and an MSHangmanLanguage which controls how the words are chosen and which alphabet/script etc is used. However, the NSDoc doesn't get to the point of loading it when it errors out.
  7. macrumors 68020


    readableTypes is only meant for NSDocument and its subclasses. If it is calling it on your HangmanGameMode class, I would look at your Info.plist file and make sure it points at your NSDocument subclass.
  8. macrumors 6502

    That was exactly what it was. XCode didn't warn me it was changing anything on opening it in the new version but sure enough:

  9. macrumors 68020


    I am not 100% sure it was XCode changing it, per se. Then again, I haven't migrated any big project and had it fail yet.

    Some environment variables might change, but in general, it seems odd that sort of entry would change at all. XCode only needs to set it once when the project is created. The only time anyone should be changing that value is when a programmer does it.
  10. macrumors 6502

    My other projects (though much smaller) migrated okay as far as I can tell so far. Just those two Info.plist (it did it as well to the other bundle class) entries. Anyways everything is now running okay so now maybe I can finally finish this project up now that there's no more school, exams, papers, or anything else to get in my way :)

Share This Page