специализированная ошибка DictionaryIterator._nativeNext () - PullRequest
0 голосов
/ 04 декабря 2018
Crashed: com.apple.main-thread
EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x722f73726573552f

Произошла часть сбоя кода:

var totalNotifications : [Int : UserNotification] = [Int : UserNotification]()
func getPendingInvitesCount() -> Int
    {     
        AppDelegate.getAppDelegate().log.debug("getPendingInvitesCount()")

        var count = 0
        for notification in totalNotifications {
            if notification.1.msgClassName == RideInvitation.rideInviteMessageClassName {
                count += 1
            }
        }
            return count
    }
}

Приложение зависало в следующих строках:

for notification in totalNotifications {
    var totalNotifications : [Int : UserNotification] = [Int : UserNotification]()  
}

Я объявил totalNotifications как:

var totalNotifications : [Int : UserNotification] = [Int : UserNotification]()

Из-за сбоя этого приложения я много пробовал, но не смог проанализировать причину сбоя в объявлении словаря, пожалуйста, помогите мне найти решение.Заранее спасибо.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...