Reputation: 12730
I'm getting the cryptic crash report, and for the life of me I cannot figure out what is going on that could cause this error. However, I'm not a skilled iOS/Swift developer, so perhaps it's obvious to someone else!
Here's the stack:
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
Here is the relevant function:
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)
})
}
Upvotes: 0
Views: 741
Reputation: 91
Is it possible that the object that you reference as self (LoginViewController?) is getting disposed? I could imagine, that the signature of the function logIn of your authenticationModel-class requires non optional attribute. However, after calling logIn() function the object is no more used and is disposed (because of [unowned self])... just put a break point in your dealloc function and see what happens. By the way, the dealloc function should not be empty to make the break point to stop
Upvotes: 1