Swift FlatUIKit: FUIAlertView not work

322 Views Asked by At

FUIAlertView does not work in swift project, although other FlatUIKit functions work normally.

When I code this...

alertView = FUIAlertView(title: "a", message: "a", delegate: self, cancelButtonTitle: "a")

I got this runtime error..

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'

I checked FUIAlertView.m. Surprisingly, the arguments are different from I coded as XCode' code completion.

- (id)initWithTitle:(NSString *)title
            message:(NSString *)message
           delegate:(id<FUIAlertViewDelegate>)delegate
  cancelButtonTitle:(NSString *)cancelButtonTitle
  otherButtonTitles:(NSString *)otherButtonTitles, ... NS_REQUIRES_NIL_TERMINATION;

Then, I tried to add an parameter.

alertView = FUIAlertView(title: "a", message: "a", delegate: self, cancelButtonTitle: "a", otherButtonTitles: "a")

But got this build error.

Extra argument 'otherButtonTitles' in call

Does anyone know how to fix it? Thanks,

0

There are 0 best solutions below