Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在iPad Air(IOS Swift)中保存KeychainItemWrapper.m中的uuid时应用程序崩溃_Ios_Swift_Keychainitemwrapper - Fatal编程技术网

在iPad Air(IOS Swift)中保存KeychainItemWrapper.m中的uuid时应用程序崩溃

在iPad Air(IOS Swift)中保存KeychainItemWrapper.m中的uuid时应用程序崩溃,ios,swift,keychainitemwrapper,Ios,Swift,Keychainitemwrapper,我的应用程序在iPadAir操作系统12.2.0中崩溃。。Fabric中的crashlytics显示了第315行的碰撞 NSAssert( result == noErr, @"Couldn't add the Keychain Item." ); 在KeychainItemWrapper.m文件中。 调用此方法以在应用程序中存储UUID: func getUUIDString() -> String { if !uuid.trimmed().isEmpty {

我的应用程序在iPadAir操作系统12.2.0中崩溃。。Fabric中的crashlytics显示了第315行的碰撞

NSAssert( result == noErr, @"Couldn't add the Keychain Item." );
在KeychainItemWrapper.m文件中。 调用此方法以在应用程序中存储UUID:

func getUUIDString() -> String {
        if !uuid.trimmed().isEmpty {
            print("uuid ==> \(uuid)")
            return uuid // return cached value
        }
        /// Generate A Dynamic UDID
        var toRet = ""
        /// Wrapper Object
        let keychainWrapperObj = KeychainItemWrapper(identifier: "ManDown", accessGroup: nil)
        /// Check is Any UDID Stored
        if let udidSavedVal = keychainWrapperObj?.object(forKey: kSecAttrService) {
            print("Old UDID is being Used now as ==> \(udidSavedVal as? String ?? "")")
            toRet = udidSavedVal as? String ?? ""
        }

        if toRet.trimmed().isEmpty {
            /// We have no UDID Saved Need to get New
            if UserDefaultManager.getUUIDSaved() != nil {
                toRet = UserDefaultManager.getUUIDSaved()!
//导致崩溃的行keychainwrapper.setobject()

我的问题是如何解决这个崩溃,以及如何至少复制这个错误以进行进一步调试。 Xcode 10.2 swift 4 钥匙链共享功能尚未启用,但应用程序仍能正常工作

Error logs: 
Fatal Exception: NSInternalInconsistencyException
0  CoreFoundation                 0x191b53518 __exceptionPreprocess
1  libobjc.A.dylib                0x190d2e9f8 objc_exception_throw
2  CoreFoundation                 0x191a6d148 +[_CFXNotificationTokenRegistration keyCallbacks]
3  Foundation                     0x1925301c8 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:]

请共享崩溃日志和导致此错误的行。您是否尝试调试代码?如果是这样的话,哪条线会导致问题?考虑到展开时的力大小,很难识别它。你可以考虑用正则表达式来打开值,如果让/Gueor允许或???例如:“让newUUIDstr=UIDevice.current.identifierForVendor?.uuidString??“fallbackValue”’嗯,我试着调试它,但它工作得很好。根本没有撞车。你可以说我无法复制错误。
Error logs: 
Fatal Exception: NSInternalInconsistencyException
0  CoreFoundation                 0x191b53518 __exceptionPreprocess
1  libobjc.A.dylib                0x190d2e9f8 objc_exception_throw
2  CoreFoundation                 0x191a6d148 +[_CFXNotificationTokenRegistration keyCallbacks]
3  Foundation                     0x1925301c8 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:]