我有這樣一類..無法找到「MyObjectViewDelegate」協議聲明時,這顯然是有?1
#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
爲什麼會突然告訴我,這找不到協議聲明「MyObjectAddViewDelegate」當我明確導入幷包含@class的協議定義在哪裏?這裏怎麼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
一切似乎完美的設置,我沒有看到任何圓形進口?!任何建議,爲什麼它可能不會在MyObjectAddView中看到協議定義?
謝謝。
檢查包含的文件。
這是兩個相互包含的標題的症狀。
有時會導致此錯誤。 – skywinder 2013-10-06 18:04:00