在我的整个应用中,设置时会收到语义问题警告ViewController.delegate = self
。我已经搜索并找到了类似的帖子,但没有一个能够解决我的问题。
ViewController.m:
GameAddViewController *gameAddViewContoller = [[navigationController viewControllers] objectAtIndex:0];
gameAddViewContoller.delegate=self;
设置时出现错误消息.delegate=self
。
GameAddViewController.h:
@protocol GameAddViewControllerDelegate <NSObject>
- (void)gameAddViewControllerDidCancel:(GameAddViewController *)controller;
- (void)gameAddViewController:(GameAddViewController *)controller didAddGame:(Game *) game;
@end
@interface GameAddViewController : UITableViewController <GameAddViewControllerDelegate>
{
sqlite3 *pitchcountDB;
NSString *dbPath;
}
@property (nonatomic, strong) id <GameAddViewControllerDelegate> delegate;
...
@end
ViewController.h:
#import "GameAddViewController.h"
@class ViewController;
@protocol ViewControllerDelegate <NSObject>
- (void)ViewControllerDidCancel:(ViewController *)controller;
@end
@interface ViewController : UIViewController <ViewControllerDelegate>
-(void) checkAndCreateFile;
@end
谁能指出正确的方向来解决警告消息?