I am facing a problem when i try to create 2 category of my OWN Simple Class ( Class name is Car). I created 2 Category for this class just for testing " Car+show.h" & "Car+Protected.h". I Just write very small methods in to all like NSLog something sting.
My Problem is that when i build application I am getting error into Category File " Can not define Category for Undefined Class Car". Please Suggest me where i am Wrong.
If you import the category header files into Car.h
, and your category header files themselves import Car.h
, then you have a circular import which is causing you your problems.
Categories are for adding functionality to a class or splitting an interface out across several headers. If you are importing your category headers into your main class header, this is defeating the point.
The category headers should only be included by files that need to use functionality defined in the category.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With