I have a class like this ..
#import "MyObjectAddView.h"
#import "MyAppDelegate.h"
#define myAppDelegate (MyAppDelegate *) [[UIApplication sharedApplication] delegate]
@class MyObjectAddView;
@interface AccountViewController : UIViewController <UIScrollViewDelegate, MyObjectAddViewDelegate, UIImagePickerControllerDelegate> {
MyObjectAddView *myAddView;
.....
}
@property (nonatomic, retain) IBOutlet MyObjectAddView *myAddView;
- (id) initWithSettings:(SettingsObject *)settings;
@end
WHY this suddenly tells me that he Cannot find the protocol declaration for "MyObjectAddViewDelegate" when I explicitly import and enable @class to define the protocol. How to set up MyObjectAddView:
#import <UIKit/UIKit.h>
#import "MyAppDelegate.h"
#define myAppDelegate (MyAppDelegate *) [[UIApplication sharedApplication] delegate]
@protocol MyObjectAddViewDelegate;
@interface MyObjectAddView : UIView <UITextFieldDelegate> {
@private
id <MyObjectAddViewDelegate> delegate;
....
@public
.....
}
@property(nonatomic, assign) id <MyObjectAddViewDelegate> delegate;
.....
@end
@protocol MyObjectAddViewDelegate <NSObject>
- (void)myObjectAddViewDidFinish:(MyObjectAddView *)addView;
@end
Everything seems perfectly tuned, and I do not see any circular imports ?! Any suggestions why this might not see the protocol definition in MyObjectAddView?
Thank.
source
share