Can't find protocol declaration for "MyObjectViewDelegate" if it is VERY there? 1

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>
// expense == nil on cancel
- (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.

+5
source share
2 answers

. , , , . @class MyObjectAddView, , , , .

+8

: . .

+6

All Articles