Just a note to the authors, when I was finishing up the Chapter 2 assignments I came across the following difference when performing the “doSomethingWeird” section on Page 57 (2nd Ed). I input the code as written and clicked Build and received the following in the debug area:
2011-08-20 20:14:00.066 RandomPossesions[33358:707] -[NSArrayM doSomethingWeird]: unrecognized selector sent to instance 0x100114880
2011-08-20 20:14:00.087 RandomPossesions[33358:707] *** Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: '-[NSArrayM doSomethingWeird]: unrecognized selector sent to instance 0x100114880’
*** First throw call stack:
I didn’t copy/paste everything because I think it is unnecessary. What I wanted to point out is that the book states I should be seeing an instance of NSCFArray receiving a message doSomethingWeird. However, the code above shows that NSArrayM is what was sent the message. I’m not sure if this incongruence is because I’m on Xcode 4 or because I may have done something wrong.
It threw an error like the book said it would!