我尝试为我的应用设置通知。我按照本教程中的说法执行操作:http://thecodeninja.tumblr.com/post/89942124085/notifications-in-ios-8-part-1-using-swift-what
但我的应用程序在
崩溃了var notificationSetting: UIUserNotificationSettings = UIUserNotificationSettings(forTypes: UIUserNotificationType.Alert | UIUserNotificationType.Badge | UIUserNotificationType.Sound, categories: nil)
除了(lldb)
之外,控制台中没有任何内容我看了我的日志,这就是我得到的:
Dec 6 21:25:14 iPhoneName <Warning>: Could not create service named com.apple.xcode.debug-gauge-data-providers.procinfo
我在IOS 7上我知道我不需要IOS 7的用户权限,但我也不想与IOS 8兼容
答案 0 :(得分:1)
UIUserNotificationSettings
:UIUserNotificationSettings Class Reference
您的代码崩溃,因为iOS 7中没有该API。