Swift FlatUIKit:FUIAlertView不起作用

时间:2015-03-01 09:47:21

标签: ios swift flatui

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

有谁知道如何修复它?谢谢,

0 个答案:

没有答案