Can I use Categories to add class methods?
问题 I want to add some class methods to UIColor. I've implemented them and everything compiles fine, but at runtime I get the following error: Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[UIColor colorWithHex:]: unrecognized selector sent to class 0x8d1d68' Here's the header file: @interface UIColor (Hex) + (UIColor*) colorWithHex: (NSUInteger) hex; @end Here's the implementation: #import "UIColor+Hex.h" @implementation UIColor (Hex) + (UIColor*) colorWithHex