相关疑难解决方法(0)

如何在iOS中实现弹出对话框

在计算之后,我想显示向用户传达消息的弹出框或警告框.有谁知道在哪里可以找到更多相关信息?

popup ios

295
推荐指数
6
解决办法
30万
查看次数

UIAlertView首先弃用了IOS 9

我尝试了几种方法来使用UIAlertController而不是UIAlertView.我尝试了几种方法,但我无法使警报行动起作用.这是我的代码在IOS 8和IOS 9中正常工作,但是出现了弃用的标志.我尝试了下面的优雅建议,但我无法在此背景下使其发挥作用.我需要提交我的应用程序,这是最后要解决的问题.感谢您的任何进一步建议.我是新手.

#pragma mark - BUTTONS ================================
- (IBAction)showModesAction:(id)sender {
NSLog(@"iapMade: %d", iapMade3);

// IAP MADE ! ===========================================
if (!iapMade3) {

    //start game here
    gamePlaysCount++;
    [[NSUserDefaults standardUserDefaults]setInteger:gamePlaysCount forKey:@"gamePlaysCount"];
    NSLog(@"playsCount: %ld", (long)gamePlaysCount);

    if (gamePlaysCount >= 4) {
    UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"Basic"
                                                     message: THREE_PLAYS_LIMIT_MESSAGE
                                                    delegate:self
                                           cancelButtonTitle:@"Yes, please"
                                           otherButtonTitles:@"No, thanks", nil];
       [alert show];

        NSString *path = [[NSBundle mainBundle] pathForResource:@"cow" ofType:@"wav"];
        _pop =[[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:path] error:NULL];
        [_pop play];
        [self dismissViewControllerAnimated:true completion:nil];

    } else {
        if (gamePlaysCount == 1)  {
            // Create …
Run Code Online (Sandbox Code Playgroud)

objective-c uialertview ios uialertcontroller

104
推荐指数
5
解决办法
11万
查看次数

标签 统计

ios ×2

objective-c ×1

popup ×1

uialertcontroller ×1

uialertview ×1