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 whereve开发者_Python百科r 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
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.
精彩评论