I'm creating an app for OS X, and it's basically finished. To test it out, I have tried it on other macs. I have tried several methods of sending the app to the other macs, but they end up with the same result. The methods include sending the .app file found in the Products folder, or sending an archived version of the app.
This works for some macs, like my laptop, and 2 others I have used. However, for 1 particular laptop belonging to my friend the app does not launch properly. The app appeared in the dock for half a second before it closed itself with an error report.
I looked at it, and the only thing I could understand was the following phrase:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[SKLabelNode labelNodeWithText:]: unrecognized selector sent to class 0x104807258'
terminating with uncaught exception of type NSException
abort() called
I checked my code, and found the method labelNodeWithText: only once in the code which is actually outside of the code of any methods:
@implementation GameScene
SKLabelNode *mousePosition = [SKLabelNode labelNodeWithText:@"Mouse Clicked Position: (0, 0)"];
..............
@end
(The reason I can do this is because the file is a .mm file rather than a .m file.)
So I tried taking the line of code inside of the didMoveToView: method and sure enough, when the app launched on my friends computer again it didn't crash. Yet the app was still bugged as the only thing on the screen was this SKLabelNode, whilst all of the other Nodes which were meant to be there were not there.
I have no idea what is causing this problem. The target for deployment is 10.9 which is lower than the versions on all of the macs I have tested on. The only difference I can think of between the macs is that my friend's mac does not have Xcode on it (which he cannot download for now until he updates to 10.10).
I have read similar issues (only 2 could be found online) which other people have experienced, yet none of the answers/solutions provided have worked for me. This is not the only app which I have experienced these issues with with my friend's computer as I have tried 2 in the past with similar results.
Can someone please help me with this problem?
labelNodeWithText:
class method of SKLabelNode
is only available since 10.10 on Mac OS X. Even if SKLabelNode
appeared in 10.9, some methods don't, like labelNodeWithText:
.
It you look at the doc of labelNodeWithText:
you'll see it clearly:
Availability
Available in OS X v10.10 and later.
It's not related to having or not the last version of XCode. Imagine if each person downloading an app should have to install XCode, that's hopefully not necessary.