Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

guifa

macrumors 6502
Original poster
Sep 19, 2002
260
0
Auburn, AL
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.

Code:
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.
 

Eraserhead

macrumors G4
Nov 3, 2005
10,434
12,250
UK
Have you done a clean rebuild? What Mac OS X/XCode version did you upgrade from? Have you changed any target settings?
 

guifa

macrumors 6502
Original poster
Sep 19, 2002
260
0
Auburn, AL
Have you done a clean rebuild? What Mac OS X/XCode version did you upgrade from? Have you changed any target settings?
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.
 

Eraserhead

macrumors G4
Nov 3, 2005
10,434
12,250
UK
Is it possible to have a play with the code? I'll take a quick look tomorrow if I have time.
 

Krevnik

macrumors 601
Sep 8, 2003
4,101
1,312
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.

NSHangmanGameMode is your NSDocument sub-class?
 

guifa

macrumors 6502
Original poster
Sep 19, 2002
260
0
Auburn, AL
NSHangmanGameMode is your NSDocument sub-class?

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.
 

Krevnik

macrumors 601
Sep 8, 2003
4,101
1,312
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.

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.
 

guifa

macrumors 6502
Original poster
Sep 19, 2002
260
0
Auburn, AL
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.

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:

Code:
		<dict>
			<key>CFBundleTypeExtensions</key>
			<array>
				<string>hangmanGameMode</string>
			</array>
			<key>CFBundleTypeIconFile</key>
			<string>GameModeIcon</string>
			<key>CFBundleTypeName</key>
			<string>GameMode</string>
			<key>CFBundleTypeRole</key>
			<string>Viewer</string>
			<key>LSTypeIsPackage</key>
			<true/>
			<key>NSDocumentClass</key>
			<string>MSHangmanGameMode</string>
			<key>NSPersistentStoreTypeKey</key>
			<string>XML</string>
		</dict>
 

Krevnik

macrumors 601
Sep 8, 2003
4,101
1,312
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:

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.
 

guifa

macrumors 6502
Original poster
Sep 19, 2002
260
0
Auburn, AL
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.
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 :)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.