【问题标题】:App crashes due to UIAlerview in ios 7 ,but working fine in ios 6由于 ios 7 中的 UIAlerview 导致应用程序崩溃,但在 ios 6 中运行良好
【发布时间】:2013-10-10 06:17:29
【问题描述】:
alertView =[[TSAlertView alloc] initWithTitle:@"ALERT" 
message:@"Please select type" delegate:self 
cancelButtonTitle:@"OK" otherButtonTitles:nil];

这在iOS 6 中运行良好,但在iOS 7 中崩溃 我委托nil,然后它工作了。我想问题可能是自我被解除的时间警报解除分配。 我的疑问是为什么 delegate:self 在iOS 6 工作以及为什么它在iOS 7 崩溃?

谁能帮我解决这个问题

【问题讨论】:

    标签: ios objective-c ios-simulator


    【解决方案1】:

    TSAlertView 现在已更新为在 IOS 7 中工作。他们添加了 customSubview 属性。所以请从这里更新最新的代码:

    TSAlertView

    【讨论】:

    • UIAlertView 也是如此。您能否解释一下为什么它在 iOS 7 中崩溃,但在 iOS 6 中工作?
    • 在IOS7中,苹果对UIAlertView做了一些限制。所以定制、改变外观等会变得困难。看代码之前很难说问题
    • 问题出在您的 UIAlertViewDelegate 定义中。给我看看这个的代码。
    • 嗨 @manujmv,我有 2 个控制器,在 MyController.m - (IBAction)showAlert:(UIButton *)sender { ValidationController *valCont=[[ValidationController alloc]init]; [valCont show]; } 在 ValidationController.m -(BOOL)show{ UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Alert" message:@"Please select type" delegate:self cancelButtonTitle:@"OK" otherButtonTitles: nil]; [alertView show]; NSLog(@"No prob in alert"); return YES; } 当点击 OK 按钮 z关于 alertview.app 在 iOS 7 中崩溃,但相同的代码在 iOS 6 上运行。你能帮我解决这个问题吗?
    • 你是否实现了任何委托方法,如 clickedButtonAtIndex 或 willDismissWithButtonIndex?
    猜你喜欢
    • 2014-02-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-10-10
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多