Я получаю загадочный отчет о сбое, и на протяжении жизни я не могу понять, что происходит, что может вызвать эту ошибку.Однако я не являюсь опытным разработчиком iOS / Swift, так что, возможно, это очевидно для кого-то еще!
Вот стек:
function signature specialization <Arg[1] = Value Promoted from Box> of closure #1 () -> () in Company.LoginViewController.(logIn in _10D245F74F8D2701C8F7339313EB1733)() -> ()
LoginViewController.swift - line 275
SIGABRT
libsystem_kernel.dylib
__pthread_kill
libsystem_c.dylib
abort
libswiftCore.dylib
0x103964000 + 2666636
libswiftCore.dylib
0x103964000 + 2666896
libswiftCore.dylib
0x103964000 + 2869624
Company
function signature specialization <Arg[1] = Value Promoted from Box> of closure #1 () -> () in Company.LoginViewController.(logIn in _10D245F74F8D2701C8F7339313EB1733)() -> () LoginViewController.swift:275
Company
_T0Ieg_IeyB_TR LoginViewController.swift:0
Company
_T0So8NSStringCIeyBy_SSIegx_TRTA AuthenticationManager.swift:0
Company
function signature specialization <Arg[0] = Owned To Guaranteed> of closure #1 (__ObjC.AFOAuthCredential) -> () in Company.AuthenticationManager.authenticate(with: Swift.String, password: Swift.String, success: (Swift.String) -> (), failure: (__ObjC.INTAuthenticationError) -> ()) -> () AuthenticationManager.swift:105
Вот соответствующая функция:
private func logIn() {
beginAuthentication()
let credentials = INTUserCredentials()
credentials.username = email.text
credentials.password = password.text
authenticationModel.logIn(with: credentials, success: { [unowned self] in
// *** Crashes here, oddly on an empty line ***
let finish = { [weak self] in
self?.endAuthentication()
if let delegate = self?.delegate {
delegate.authenticationViewControllerDidLogin(self?.registrationInfoContainer)
}
}
}, failure: { [weak self] errorMessage in
self?.showErrorMessage(errorMessage)
})
}