1
var categories: NSSet = NSSet(object: firstCategory)
let types: UIUserNotificationType = UIUserNotificationType.Badge | UIUserNotificationType.Alert
沒有工作,並說二進制運算符'|'不能適用於兩個「UIUserNotificationType」操作數UIUserNotificationSettings不能工作
var categories: NSSet = NSSet(object: firstCategory)
var mySettings = UIUserNotificationSettings = UIUserNotificationSettings(forTypes: [.Alert, .Badge], categories: categories)
也沒有工作,並表示無法指定類型的不可變的表達「UIUserNotificationSettings.Type
哇,非常感謝,我寫錯誤':'爲'='...... – postman99
有時Swift錯誤有誤導性。 – Mark