SeriousSam
SeriousSam

Reputation: 229

Category and its Core classes

If I create a category on one of the core classes in IOS, Eg UIImage, then will i have to always import the header where in I have declared its interface, or because UIImage being part of UIKit, will automatically include the new formed category wherever there is a UIKIT import??

Another thing. What if i create a category and not decide to use its functions altogether in some classes? Will those be still accesible?

http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/ObjectiveC/Chapters/ocCategories.html#//apple_ref/doc/uid/TP30001163-CH20-SW1

Upvotes: 0

Views: 567

Answers (1)

Sherman Lo
Sherman Lo

Reputation: 2759

You need to import the category into a class (Generally the .m file) where you use one of the methods in that category

There is no need to import the category if you're not using any of those category methods in a class.

Upvotes: 1

Related Questions