繁体   English   中英

有人可以帮我解决这个错误吗

[英]can someone help me to fix this error

    UIAlertController *alert = [[UIAlertController alloc] initWithTitle: alertString message:nil
delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
    [alert show];

我有这个错误:

No visible @interface for 'UIAlertController' declares the selector 'show'

和这个: No visible @interface for 'UIAlertController' declares the selector 'initWithTitle:message:delegate:cancelButtonTitle:otherButtonTitles:'

声明UIAlertController的步骤是UIAlertController

UIAlertController *alertController = [UIAlertController alertControllerWithTitle:title message:message preferredStyle:UIAlertControllerStyleAlert];

// add action button
UIAlertAction *okAction = [UIAlertAction actionWithTitle:actionTitle style:UIAlertActionStyleDefault handler:nil];

[alertController addAction:okAction]; // add action button to alert controller



// present alert controller in view
[self presentViewController:alertController animated:YES completion:nil];

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM