I try to find answer for my question but failed.
Can i do any workaround to let two classes import each other.
#import "classB.h"
@interface classA : NSObject
{
classB bObject;
}
#import "classA.h"
@interface classB : NSObject
{
classA aObject;
}
Thanks
Instead of actually importing your headers in your headers, use
@classto make a forward class declaration:This just tells the compiler that
classAandclassBare classes, without actually loading any of the interfaces.If you use any of
classA‘s methods inclassB, you’ll need theclassAinterface inclassB‘s implementation, in which case you can just importclassB.hinclassA.h(or vice versa).