Category methods added to specific class doesn’t work at its subclass.
For me, I’m using JSONKit to manipulate JSON. JSONKit returns JKArray subclassing NSArray. And I have several methods added to NSArray. But when I execute my program, unrecognized selector sent to instance runtime exception thrown with the method.
How can I use the category method?
I solved the problem by adding
-ObjCflag to Other Linker Flags on build setting.Here’s description.
http://developer.apple.com/library/mac/#qa/qa1490/_index.html
My
NSArrayaddition andJSONKitcodes are in separated static library, and it was not linked well without the flag. Program is working well now. And also, the linker bug described the document looks fixed.