大佬教程收集整理的这篇文章主要介绍了iOS App Store 应用在登录期间崩溃(未开发),大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
所以这可能是因为 UserDefaults 在一段时间后被重置,也许是因为我经常更新操作系统,但是一段时间后我的 iOS 应用程序的发布版本会在我的登录屏幕上崩溃,可能是我检查的地方用于保存的凭据(在 UserDefaults 中)。重新安装应用程序可以解决问题。控制台返回很多:
不支持在主线程之外使用 UIKit 视图自定义 API。 -setAlignsToKeyboard: 发送到 <_uialertcontrollerview: layer="<CALayer:">>@H_618_6@
我的系统日志在此线程上显示错误:
异常类型:EXC_CRASH (SIGABRT) 异常代码:0x0000000000000000,0x0000000000000000 例外说明:EXC_CORPSE_NOTIFY 由线程触发:4
应用特定信息: abort() 调用
线程 4 名称:调度队列:com.apple.NSURLSession-delegate 线程 4 崩溃:0 libsystem_kernel.dylib 0x00000001bfb4e414 0x1bfb26000 + 164884 1 libsystem_pthread.dylib 0x00000001dd6a8b50 0x1dd6a6000 + 11088 2 libsystem_c.dylib 0x000000019b027b74 0x19afb1000 + 486260 3 libc++abi.dylib 0x00000001a6d1acf8 0x1a6d07000 + 81144 4 libc++abi.dylib 0x00000001a6d0be4c 0x1a6d07000 + 20044 5 libobjc.A.dylib 0x00000001a6c14f64 0x1a6c0e000 + 28516 6 libc++abi.dylib 0x00000001a6d1a0e0 0x1a6d07000 + 78048 7 libc++abi.dylib 0x00000001a6d1a06c 0x1a6d07000 + 77932 8 libdispatch.dylib 0x00000001917eddc4 0x1917ea000 + 15812 9 libdispatch.dylib 0x00000001917f510c 0x1917ea000 + 45324 10 libdispatch.dylib 0x00000001917f5c90 0x1917ea000 + 48272 11 libdispatch.dylib 0x00000001917ffd78 0x1917ea000 + 89464 12 libsystem_pthread.dylib 0x00000001dd6a9814 0x1dd6a6000 + 14356 13 libsystem_pthread.dylib 0x00000001dd6b076c 0x1dd6a6000 + 42860
这是我用来检查保存的凭据的一些代码。在后端 API 中,我看不到任何登录尝试。如果有帮助,我可以在它崩溃之前的一瞬间看到这个视图控制器。不确定这是否排除了 vIEwdIDload。
overrIDe func vIEwDIDLoad() {
super.vIEwDIDLoad()
addLoadingSpinner()
bLogIn.titleLabel?.Font = UIFont.setToVoicelight()
self.tfCustomerID.delegate = self
self.tfUsername.delegate = self
self.tfpassword.delegate = self
tfUsername.keyboardType = .default
tfpassword.textContentType = .password
setupUI()
if UserDefaults.standard.String(forKey: UserDefaultsKeys.session) != nil
&& UserDefaults.standard.String(forKey: UserDefaultsKeys.savedCred) == "True" {
login_session = UserDefaults.standard.String(forKey: UserDefaultsKeys.session)!
check_session()
}
else if UserDefaults.standard.String(forKey: UserDefaultsKeys.savedCred) == "True" &&
UserDefaults.standard.String(forKey: UserDefaultsKeyS.UsesBiometrics) == "True" {
prompttouchOrFacEID()
}
removeLoadingSpinner()
}
overrIDe func vIEwWillAppear(_ animated: Bool) {
AppDelegate.AppUtility.lockOrIEntation(UIInterfaceOrIEntationMask.porTrait,andRotateto:
UIInterfaceOrIEntation.porTrait)
cbSave.ischecked = UserDefaults.standard.String(forKey: UserDefaultsKeys.savedCred) == "True"
addobservers()
}
func check_session() {
UserDefaults.standard.set(login_session,forKey: "session")
UserInfo.access_token = UserDefaults.standard.String(forKey: "session")!
var request = URLrequest(url: NSURL(String: checksession_url)! as URL)
request.httpR_486_11845@ethod = .GET
request.addValues(...)
let task = URLSession.shared.dataTask(with: request) { data,response,error in
if let httpStatus = response as? httpURLResponse,httpStatus.statusCode == 200 {
//VERIFIED THAT NEVER GETTinG TO API
dispatchQueue.main.async {
...
}
} else {
self.prompttouchOrFacEID()
UserDefaults.standard.set(nil,forKey: UserDefaultsKeys.session)
}
}
task.resume()
}
这是我的生物识别提示代码:
func prompttouchOrFacEID() {
//create context for touch auth
let authenticationContext = LAContext()
var error: NSError?
authenticationContext.localizedfallBACktitle = ""
let biometricType = authenticationContext.biometricType
//check if the device has a fingerprint sensor,exit if not
guard authenticationContext.canEvaluatePolicy(.deviceownerAuthenticationWithBiometrics,error: &error) else {
let title = "Error"
var message = ""
switch biometricType {
case .facEID:
message = "This device does not have a FacEID sensor or the sensor is not enabled."
case .touchID:
message = "This device does not have a touchID sensor or the sensor is not enabled."
case .none:
message = "This device does not have any sensors to use touchID or FacEID"
}
Alertservice.showAlert(on: self,title: title,message: messagE)
UserDefaults.standard.set("false",forKey: UserDefaultsKeyS.UsesBiometrics)
removeLoadingSpinner()
return
}
authenticationContext.evaluatePolicy(.deviceownerAuthenticationWithBiometrics,localizedReason: "Please use your fingerprint to authenticate.",reply: { [uNowned self] (success,error) -> VoID in
if (success) {
//fingerprint recognized,set this possible and go to vIEw controller
OperationQueue.main.addoperation({ () -> VoID in
self.fillinUserDetails()
self.login_Now(
username:self.tfUsername.text!,password: self.userDefaults.String(forKey: UserDefaultsKeys.password)!,customer: self.tfCustomerID.text!)
})
}
})
}
只是一个疯狂的镜头,但是您的 plist 文件中有 NSFacEIDUsageDescription
键吗?我记得几个月前遇到过这样的问题。
以上是大佬教程为你收集整理的iOS App Store 应用在登录期间崩溃(未开发)全部内容,希望文章能够帮你解决iOS App Store 应用在登录期间崩溃(未开发)所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。