Ask your own question, for FREE!
Computer Science 10 Online
OpenStudy (anonymous):

How do you add a method to the UIImage class in xcode 4? I want to add a scaling method that doesn't give grainy images.

OpenStudy (shadowfiend):

You need to add a category. Categories look something like this: @interface UIImage (Scaling) { } - (id)scaleToWidth:(int)width height:(int)height @end @implementation UIImage (Scaling) - (id)scaleToWidth:(int)width height:(int)height { // ... code ... } @end

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!