我正在使用FlatUIKit来自定义我自己的按钮。但是当按下按钮时,应用程序会崩溃。 我有以下代码与FlatUIKit的示例代码相同。我试图通过CocoaPods安装它或手动添加它。
FUIButton *myButton = [[FUIButton alloc] initWithFrame:CGRectMake(10, 340, 240, 60)];
myButton.buttonColor = [UIColor turquoiseColor];
myButton.shadowColor = [UIColor greenSeaColor];
myButton.shadowHeight = 3.0f;
myButton.cornerRadius = 6.0f;
myButton.titleLabel.font = [UIFont boldFlatFontOfSize:16];
[myButton setTitle:@"hahahaahhhahah" forState:UIControlStateNormal];
[myButton setTitleColor:[UIColor cloudsColor] forState:UIControlStateNormal];
[myButton setTitleColor:[UIColor cloudsColor] forState:UIControlStateHighlighted];
[self.view addSubview:myButton];
[myButton addTarget:self action:@selector(weiboLoginAction:) forControlEvents:UIControlEventTouchUpInside];
以下是iOS 6中的崩溃日志:
2014-09-04 15:47:13.298 comChat[37118:907] -[UICFFont weiboLoginAction:]: unrecognized selector sent to instance 0x8a914e0
在iOS 7中,没有崩溃日志。