Gnomo
Registered
I've started learning Objective-C using the developer documentation and a book Learning Cocoa with Objective-C and for the most part I think I understand the language, so I've decided to try out my own project rather than just working with the examples in the book.
However, I have run into a problem and I though I would ask for some advice, since the project seems to be beyond the scope of the book and I can't find anything in the documentation.
I have two objects: room and exit. The room has an mutable array that is to contain a list of exits. So I have to include "exit.h" in the room.h file so that I won't get an error when I declare the function "- (void)addExitexit *)newExit;"
However, I also need to have the exit class point to the room that the exit goes to. So I need the "room.h" file included in the "exit.h" file so that I won't get an error when I declair the property "room * exitsTo;"
Now, regardless of the order in which I include the files in the main program, I get an error that either type exit or type room has not been defined.
Anyone know how I can solve this without changing the objects too much?
Thanks in advance.
However, I have run into a problem and I though I would ask for some advice, since the project seems to be beyond the scope of the book and I can't find anything in the documentation.
I have two objects: room and exit. The room has an mutable array that is to contain a list of exits. So I have to include "exit.h" in the room.h file so that I won't get an error when I declare the function "- (void)addExitexit *)newExit;"
However, I also need to have the exit class point to the room that the exit goes to. So I need the "room.h" file included in the "exit.h" file so that I won't get an error when I declair the property "room * exitsTo;"
Now, regardless of the order in which I include the files in the main program, I get an error that either type exit or type room has not been defined.
Anyone know how I can solve this without changing the objects too much?
Thanks in advance.