相关疑难解决方法(0)

Swift UIAlertController - > ActionSheet iPad iOS8崩溃

目前我的ActionSheet遇到了大麻烦.在iPhone上它运行良好,但在iPad上它只会崩溃

我用一个按钮创建一个新项目

import UIKit

extension ViewController : UIActionSheetDelegate {

    func actionSheet(actionSheet: UIActionSheet, didDismissWithButtonIndex buttonIndex: Int) {

        if actionSheet.tag == 0 {
            if buttonIndex == 1 {
                // doing something for "product page"
            } else if (buttonIndex == 2) {
                // doing something for "video"
            }
        }
    }

}

class ViewController: UIViewController, UIActionSheetDelegate {
    @IBAction func test(sender: AnyObject) {

        let systemVersion: NSInteger = (UIDevice.currentDevice().systemVersion as NSString).integerValue
        if systemVersion < 8 {
            // iOS7:
            let action:UIActionSheet = UIActionSheet(title: "Change Map Type", delegate: …
Run Code Online (Sandbox Code Playgroud)

iphone uiactionsheet ipad swift

60
推荐指数
3
解决办法
3万
查看次数

在iPhone的警报视图

我是iPhone应用程序开发的新手.我想用2个按钮设计一个警报视图:OKCancel.当用户触摸OK按钮时,我将打印出一条消息hello.当他们触摸Cancel按钮时,我会打印出来cancel.

请帮忙; 我该怎么做呢?

iphone cocoa-touch objective-c

25
推荐指数
3
解决办法
7万
查看次数

何时使用UIAlertView与UIActionSheet

是否存在UIAlertView比UIActionSheet更好用的情况?您将使用其中一个的典型场景是什么?

我正在编程导航栏按钮以在外部应用程序中打开UIWebView,起初我开始编写UIAlertView,然后我认为操作表可能更适合这种情况.

是否有适用于不同情况的正式指南?谢谢.

iphone cocoa-touch objective-c alerts

23
推荐指数
1
解决办法
9764
查看次数

标签 统计

iphone ×3

cocoa-touch ×2

objective-c ×2

alerts ×1

ipad ×1

swift ×1

uiactionsheet ×1