好的,所以我刚开始使用 objective-c 和 iv 得到一个非常随机的错误我不确定它试图向我指出什么 我在 xviewContoller.h 上有这个
@property (weak, nonatomic) IBOutlet UIButton *helloButton;
在 xviewController.m 上连同
- (IBAction)showAlrt:(id)sender;
在本页底部的方法中使用这个
- (IBAction)showAlrt:(id)sender {
UIAlertView* alert = [[UIAlertView alloc]
initWithTitle:@"xxxx"
message:@"xxxx"
delegate:nil
cancelButtonTitle:@"Close"
otherButtonTitles:nil];
[alert show];
[self.helloButton setTitle:@"click"]
forState:UIControlStateNormal];
}
然后我收到这个错误
“UIButton”没有可见的@interface 声明选择器“setTitle”
喜欢[self.helloButton setTitle.....
有人可以帮忙吗
最佳答案
[self.helloButton setTitle:@"click"]
forState:UIControlStateNormal];
改为
[self.helloButton setTitle:@"click" forState:UIControlStateNormal];
关于ios - 'UIButton' 没有可见的@interface 声明选择器 'setTitle',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26193070/