我有一个 Xcode 项目,想从一个文件切换视图,文件名是 Score(没有 xib,它只有 Score.h 和 Score.m),通过使用我的文件 Score.m 中的 UIbutton,但我不能这样做..
使用此代码:
UIButton *btn1 = [UIButton buttonWithType:UIButtonTypeCustom];
btn1.frame = CGRectMake(200, 400, img3.size.width/2, img3.size.height/2);
[btn1 setImage:img3 forState:UIControlStateNormal];
[btn1 setImage:img4 forState:UIControlStateDisabled];
[self addSubview:btn1];
if(btn1.selected) {
View *second =[[View alloc] initWithNibName:nil bundle:nil];
[self presentModalViewController:second animated:YES];
}
我收到此错误: Receiver type 'Score' for instance message doesn't declare a method with selector 'presentModalViewController : animated
请帮忙 。