You will be be redirected to the blog in a moment...

Or you can click the link below to proceed:
Objective C forward declaration

Was 'debugging' this for few hours, nothing more than not reading the documentations carefully. I needed to create a forward declaration of a class A in my class B as I would need to access some properties in class A.However when compiling XCode was complaining to me about 'error: request for member in something not a structure or union'. Cracked my brain, tried rewriting my accessors in class A. Checking the access rights, property declarations, all was in order.Finally did the google ritual and found out that to access properties in a forward declared class you must include the interface file in the implementation file of the class accessing. Too abstract to talk about here's the example:Class B .h file#import ....//forward declare class a@class A@interface BClass B .m file//import interface file for class A#import "classA.h"@implementation B.... A.someProperty = @"Got me there";Hope this helps.. :)

 

Want to be redirected immediately?
Register yourself at Ping.sg to get rid of this page and also to get your read counted as Pong.