当我传递一个整数时,我有一个 tableviewcontroller 和一个 detailtableviewcontroller
-[UITableViewController setSurveyNumber:]: 无法识别的选择器发送到实例
Bizard 的事情与 tableviewcontroller 的代码完全相同 - > uiviewcontroller
表 -> 表代码
-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{
if([segue.identifier isEqualToString:@"pushSurveyDetails"])
{
NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow];
NSInteger row = [indexPath row];
SurveyDetailViewController *surveyController = [segue destinationViewController];
surveyController.surveyNumber=row;
}
}
在 SurveyDetailViewController.h
@interface SurveyDetailViewController : UITableViewController
{
}
@property int surveyNumber;
@end
SurveyDetailViewController.m
@implementation SurveyDetailViewController
@synthesize surveyNumber;
- (void)viewDidLoad
{
[super viewDidLoad];
NSLog(@"Survey Number is %i",surveyNumber);
}
为什么会出现这个错误?