I have a category that extends NSMutableArray with a shuffle method. The category is declared and implemented in the .h file, which is included in the .pch file. Worked fine on iOS 3.xx and 4.xx. Yesterday I installed Xcode 4.2. A recompiled application with the base SDK installed in 5.0 and the deployment target for 3.2 throws -[__NSArrayM shuffle]: unrecognized selector sent to instance ...
I tried the simulator iPhone 5.0, the simulator iPad 5.0, iPhone 4G with iOS 5 - no difference.
Now, if I moved the declaration / implementation to .m , where the class sending the shuffle message is implemented, the application works fine. The original .h indeed imported - if I just copy the code from the original .h to .m , the compiler complains about a duplicate declaration.
source share