私はiOS開発を初めて利用しています!私はUILocalNotification
でアプリを作成しようとしました。ここに私がしたことがあります:applicationIconBadgeNumberが更新されていないか増加していません
func createLocalNotification(structure:Structure) {
let localNotification = UILocalNotification()
localNotification.category = "CATEGORY"
localNotification.alertBody = "\(structure.messageBody)"
localNotification.alertAction = "see"
localNotification.soundName = UILocalNotificationDefaultSoundName
localNotification.userInfo = ["uuid":structure.UUID]
localNotification.fireDate = structure.date
localNotification.applicationIconBadgeNumber = UIApplication.sharedApplication().applicationIconBadgeNumber + 1
print(localNotification)
UIApplication.sharedApplication().scheduleLocalNotification(localNotification)
}
それはうまく動作します!問題の行はapplicationBadgeNumber
です。これはproperty
のようです。しかし、アプリが非アクティブな状態では増加しません。そして、アプリケーションが起動します。Xcodeは次のようなエラーを表示します。
レンダリングされていないビューをスナップショットすると、空のスナップショットになります。画面の更新後にスナップショットまたはスナップショットを作成する前に、ビューが少なくとも1回レンダリングされていることを確認してください。
どういう意味ですか?何が悪いですか?ご協力いただきありがとうございます!