Monday, August 26, 2013

"Unknown Type Name ..." error in Objective C/ XCode

XCode sometimes shows this error when we include header files in a cyclic manner:

e.g

B.h
#import "A.h"

A.h

#import "B.h"

I got this error when I had an instance of class A as a member of class B and an instance of class B as a member of class A.

Resolution:

Used "@class A" forward declaration in B.h and imported A.h in B.mm

No comments:

Post a Comment