所以我有 -
#import <UIKit/UIKit.h>
#import "RateView.h"
@interface BasicCardViewController : UIViewController<RateViewDelegate>
@property (weak, nonatomic) IBOutlet UILabel *label;
@property(copy, nonatomic)NSString *message;
@property(atomic)NSInteger rating;
@property (strong, nonatomic) IBOutlet RateView *rateView;
@property (weak, nonatomic) IBOutlet UILabel *ratingLabel;
@end
和这 - 在我的RateView.h文件中。
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
@class RateView;
@protocol RateViewDelegate
-(void)rateView:(RateView *)rateView ratingDidChange:(float)rating;
@end
@interface RateView : UIView
@property(strong,nonatomic)UIImage* fullSelectedStar;
@property(strong,nonatomic)UIImage* notSelectedStar;
@property(strong, nonatomic)UIImage* halfSelectedStar;
@property (assign, nonatomic)float rating;
@property(assign) BOOL editable;
@property (strong) NSMutableArray* imageViews;
@property(assign,nonatomic) int maxRating;
@property(assign) int midMargin;
@property(assign)int leftMargin;
@property (assign) CGSize minImageSize;
@property (assign) id <RateViewDelegate> delegate;
@end
但我得到两个错误 -
1.无法找到'TooviaRateViewDelegate'的协议声明 2.未知类型名称“RateView”
我已经尝试清理,并且我已经验证了文件应该在哪里(它们的文件路径是项目)。
为什么会这样?
编辑 - 我的AppDelegate.h
#import <UIKit/UIKit.h>
#import "SearchViewController.h"
@interface TooviaAppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@property NSOperationQueue *queue;
@property (strong, nonatomic) NSDictionary *userProfile;
@property (strong, nonatomic) SearchViewController *searchViewController;
- (NSOperationQueue*) getOperationQueue;
- (id)getSettings:(NSString *)keyPath;
- (void) saveCookies;
@end
我的SearchViewController还存在一些问题
#import <UIKit/UIKit.h>
#import "BasicCardViewController.h"
@interface SearchViewController : UIViewController
<UISearchBarDelegate, UISearchDisplayDelegate, UITableViewDataSource, UITableViewDelegate>
- (IBAction)searchButtonClicked:(UIButton *)sender;
- (IBAction)backgroundTap:(id)sender;
@property (weak, nonatomic) IBOutlet UITableView *resultTable;
@property (weak, nonatomic) IBOutlet UITextField *searchBar;
@property (strong, nonatomic) NSArray *resultsTuples;
@property (weak, nonatomic) IBOutlet UIButton *searchButton;
@property (copy, nonatomic) NSArray *controllers;
@property(strong,nonatomic)BasicCardViewController *detailController;