암호가 일치하면 경고 메시지를 표시하려고합니다.Alert - libC++ abi.dylib : NSException 유형의 catch되지 않은 예외로 종료합니다.
1) 웹 서비스가 호출되고 암호
2) 흐름이 displayAlert 함수가 호출됩니다
if(userPasswd == sysPasswd)
{
displayAlert(userMessage: "Welcome! You have been authenticated")
return
}
암호 경기에 관련된 경우 조건을 입력을 반환 : 모든 아주 잘 작동 성공적으로 :
func displayAlert(userMessage: String)
{
// create the alert
let myAlert = UIAlertController(title: "Alert", message: userMessage, preferredStyle: UIAlertControllerStyle.alert)
// add an action (button)
myAlert.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.default, handler: nil))
// show the alert
self.present(myAlert, animated: true, completion: nil)
}
마지막 문이 실행될 때이 오류를 제공
libc++abi.dylib: terminating with uncaught exception of type NSException
왜 이런 일이 발생합니까? 저는 스위프트에서 초보자이며 여전히 로프를 배우고 있습니다. 노란색 플래그 등은 없습니다.
네트워크 메소드가 반환 될 때 'self'가 확실합니까? – the4kman
정확한 오류 메시지를 보려면 디버거에서 예외 중단 점을 설정하십시오. –
경고를 표시하는 동안 주 스레드에 있습니까? 나는 당신이 .. .. –