Using a UIColor category in iOS 7 and Objective c
问题 I have a UIColor+MyLayout.m file such as: @implementation UIColor (Layout) - (UIColor *) textBackground { UIColor *lightGreen = [UIColor colorWithRed:0.0f/255.0f green:178.0f/255.0f blue:238.0f/255.0f alpha:1.0f]; return lightGreen; } @end I have added the .h file to my viewcontroller.m, but how do I call this into a UIColor? UIColor *myColor = ? 回答1: Would be better if you do the following: @implementation UIColor (Layout) + (UIColor *) textBackground { UIColor *lightGreen = [UIColor