Crashlytics
서비스 보고서 일부 충돌 (약 30 충돌/1000 개 세션에 대한 18 사용자) 여기NSDateFormatter dateFromString 충돌
내 코드 :이 경우
Crashed: NSOperationQueue 0x170422a80 :: NSOperation 0x170257190 (QOS: UTILITY)
0 AppName 0x100085f84 specialized SNotification.mapping(Map) ->() (SNotification.swift:42)
1 AppName 0x100084ff4 SNotification.mapping(Map) ->() (SNotification.swift:29)
2 AppName 0x100085a78 protocol witness for Mappable.mapping(Map) ->() in conformance SNotification (SNotification.swift:29)
:
var brutDate: String = ""
brutDate <- map["send_date"]
let dateFormatter = NSDateFormatter()
dateFormatter.dateFormat = "yyyy-MM-dd HH:mm:ss"
date = dateFormatter.dateFromString(brutDate)! // here is the crash (this is line 42)
Crashlog입니다 최후의 값은 2017-01-31 20:02:08
나는 아니오 앱이 내 모바일을 크래시하게 만들 수 없습니다 ...
EDIT : 캐나다에 앱이 배포되어 있으며 Locale
문제가 있습니까?
느낌표가 있으면 앱이 다운 될 수 있습니다. 선택 사항을 안전하게 처리하는 방법에 대해 알아보십시오. – vadian
let 또는 guard가 선택 다운 캐스팅을 처리하는 이유는 무엇입니까? ?? – Tuhin
예 다른 문제인지 알고 있습니다. date 변수가 설정되어 있지 않으면 날짜는 nil이됩니다. –