好吧所以我刚开始用目标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'
on like [self.helloButton setTitle .....
有人可以帮忙吗。
答案 0 :(得分:3)
[self.helloButton setTitle:@"click"]
forState:UIControlStateNormal];
更改为
[self.helloButton setTitle:@"click" forState:UIControlStateNormal];