2011-08-22 53 views
1

我收到一個錯誤:找不到'SentencesDelegate'的協議聲明。 但是我正在導入定義協議的頭文件。 這些是2個文件(分別定義和使用的協議):無法找到協議聲明,但我實際上導入它

SentencesViewController.h

#import <UIKit/UIKit.h> 
#import "SansnuageAppDelegate.h" 

// Define a new protocol 
// Best practice - make this protocol conform to the <NSObject> protocol 
@protocol SentencesDelegate <NSObject> 

// By default, methods are "required"; you can change this by prefacing methods with "@optional" 
- (void) setSentence:(NSString *)sentence; 

@end 

@interface SentencesViewController : UITableViewController 
{ 
    SansnuageAppDelegate* appDelegate; 
    NSArray *sentencesList; 
} 

@property (nonatomic, assign) id <SentencesDelegate> delegate; 

@end 

ComposerViewController.h

#import <UIKit/UIKit.h> 
#import "SentencesViewController.h" 
#import "ANColorPicker.h" 
#import "SansnuageAppDelegate.h" 

@interface ComposerViewController : UIViewController <SentencesDelegate, ANColorPickerDelegate, UITableViewDelegate, UITableViewDataSource> 
{ 
    ANColorPicker * picker; 
    UIView * colorView; 
    UITableView * composerTableView; 

    NSMutableArray *dataList; 
    SansnuageAppDelegate* appDelegate; 

} 

@property(nonatomic, retain) UIView * colorView; 
@property(nonatomic, retain) IBOutlet UITableView *composerTableView; 
@property(nonatomic, retain) IBOutlet UIButton *previewB; 
@property(nonatomic, retain) IBOutlet UIButton *sendB; 

@end 

感謝

+0

在第一個代碼塊的第二行中是否真的意味着'#import SansnuageAppDelegate;'? – Yuji

+0

@Yuji uhm,是的,我真的是這個意思,我需要委託來獲得managedObjectContext – aneuryzm

+1

沒有「.h」? – onnoweb

回答

2

好了,所以該解決方案是我在執行文件中導入#import「SentencesViewController.h」 。非常愚蠢的錯誤,但錯誤描述根本沒有幫助。

相關問題