FUIAlertView在 swift 项目中不起作用,尽管其他 FlatUIKit 功能正常工作。
当我编码这个...
alertView = FUIAlertView(title: "a", message: "a", delegate: self, cancelButtonTitle: "a")
我得到了这个运行时错误..
2015-03-01 18:32:48.852 Oracle[21705:2263344] -[FUIAlertView initWithTitle:message:delegate:cancelButtonTitle:]: unrecognized selector sent to instance 0x7fc685a41b60
2015-03-01 18:32:48.902 Oracle[21705:2263344] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[FUIAlertView initWithTitle:message:delegate:cancelButtonTitle:]: unrecognized selector sent to instance 0x7fc685a41b60'
我检查了 FUIAlertView.m。令人惊讶的是,这些参数与我编码为 XCode 的代码完成不同。
- (id)initWithTitle:(NSString *)title
message:(NSString *)message
delegate:(id<FUIAlertViewDelegate>)delegate
cancelButtonTitle:(NSString *)cancelButtonTitle
otherButtonTitles:(NSString *)otherButtonTitles, ... NS_REQUIRES_NIL_TERMINATION;
然后,我尝试添加一个参数。
alertView = FUIAlertView(title: "a", message: "a", delegate: self, cancelButtonTitle: "a", otherButtonTitles: "a")
但是得到了这个构建错误。
Extra argument 'otherButtonTitles' in call
有谁知道如何修理它?谢谢,