我的新应用程序已经在App Store中出现问题 . 问题是,当我创建它时,我选择仅用于iPhone,一些用户报告它也可用于iPad和iPad 2应用程序崩溃..

我使用了自动布局和大小类功能,但所有工作都在紧凑宽度,任何高度,所以所有iPhone .

同样在“Build Settings”上,“Targeted Device Family”标志设置为“1”,即iPhone / iPod .

更新:收到来自用户的电子邮件报告该应用程序加载正常但是当他在UITextField上输入数据时,它会崩溃 .

因此,检查我的按钮操作并在真正的iPad上运行代码进行测试我得到一个零对象,但不知道从哪里来 .

这是代码:

@IBAction func btnHourRate(sender: UIBarButtonItem) {


    if self.hourRate > 0 {
        alert = UIAlertController(title: "Enter Hourly Rate", message: "Your current rate is: $\(strRate)", preferredStyle: UIAlertControllerStyle.Alert)

    } else {
        alert = UIAlertController(title: "Enter Hourly Rate", message: "", preferredStyle: UIAlertControllerStyle.Alert)
    }

    //Configure UITextField
    alert.addTextFieldWithConfigurationHandler({(textField: UITextField!) in
        textField.placeholder = "0.00"
        textField.textAlignment = NSTextAlignment.Center
        textField.keyboardType = UIKeyboardType.NumbersAndPunctuation
        self.tField = textField
    })

    alert.addAction(UIAlertAction(title: "Cancel", style: UIAlertActionStyle.Cancel, handler:nil))
    alert.addAction(UIAlertAction(title: "Ok", style: UIAlertActionStyle.Default, handler:{ (UIAlertAction)in

        //Saving Rate to NSUserDefaults
        self.defaults.setObject(self.tField.text, forKey: "Rate")
        self.defaults.synchronize()

    }))

    self.presentViewController(alert, animated: true, completion:nil)
}