I have some wierdness going on that I don't understand. Perhaps its some "import" feature I don't understand. Perhaps it's cuz it's February (sarcasm).
Derived from the "first iPhone application" hello program, I have the following pertinent code:
ControlPanel.h:
...
#import <UIKit/UIKit.h>
#import "MainViewController.h"
#import "Connection.h"
@protocol ControlDelegate
- (BOOL)sendSetPoint: (float)setPoint Group: (int)groupNumber;
@end
...
mainViewController.h:
...
#import <UIKit/UIKit.h>
#import "ControlPanel.h"
#ifdef SeeForumText
@protocol ControlDelegate
- (BOOL)sendSetPoint: (float)setPoint Group: (int)groupNumber;
@end
#endif
@interface MainViewController : UIViewController <UITextFieldDelegate, DisplayDelegate, UIScrollViewDelegate> {
// Declare Display Delegate
id<ControlDelegate> controlDelegate;
...
Note that I've identified some lines above with #ifdef SeeForumText.
When those lines are ABSENT, as I believe SHOULD be the case, I get an error message on the id...controlDelegate line that reads "Cannot find protocol declaration for 'ControlDelegate'"
When those lines are PRESENT, I get a warning message within them that reads "Duplicate declaration for protocol 'ControlDelegate'. I make no other changes whatsoever.
It seems I'm d*mned if I do, and d*mned if I don't. This makes no sense to me. I've been moving forward with the warning, because it allows me to make progress on my development. But, at some point, I need to figure this out and get rid of the warning.
I see the circular import of .h files, but it's necessary because they both reference each other. I thought import took care of that. But am I getting this as a side effect?
Your help is greatly appreciated.