在 BOXKeychainItemWrapper.m 中崩溃
Crash in BOXKeychainItemWrapper.m
应用程序偶尔会在方法中突然崩溃
重置KeychainItem
在第 210 行:
NSAssert( junk == noErr || junk == errSecItemNotFound, @"Problem deleting current dictionary." );
有什么办法可以避免crash/Any更新这个问题吗?
方法:
- (void)resetKeychainItem
{
@synchronized(self) {
OSStatus junk = noErr;
if (self.keychainItemData != nil)
{
NSMutableDictionary *tempDictionary = [self dictionaryToSecItemFormat:self.keychainItemData];
junk = SecItemDelete((CFDictionaryRef)tempDictionary);
NSAssert( junk == noErr || junk == errSecItemNotFound, @"Problem deleting current dictionary." );
// Default data for keychain item.
self.keychainItemData = [self defaultKeychainItemDataDictionaryWithIdentifier:self.identifier
accessGroup:self.accessGroup];
}
}
}
我们将通过您在 GitHub 中提交的问题进行回复:
https://github.com/box/box-ios-sdk/issues/117
应用程序偶尔会在方法中突然崩溃 重置KeychainItem 在第 210 行:
NSAssert( junk == noErr || junk == errSecItemNotFound, @"Problem deleting current dictionary." );
有什么办法可以避免crash/Any更新这个问题吗?
方法:
- (void)resetKeychainItem
{
@synchronized(self) {
OSStatus junk = noErr;
if (self.keychainItemData != nil)
{
NSMutableDictionary *tempDictionary = [self dictionaryToSecItemFormat:self.keychainItemData];
junk = SecItemDelete((CFDictionaryRef)tempDictionary);
NSAssert( junk == noErr || junk == errSecItemNotFound, @"Problem deleting current dictionary." );
// Default data for keychain item.
self.keychainItemData = [self defaultKeychainItemDataDictionaryWithIdentifier:self.identifier
accessGroup:self.accessGroup];
}
}
}
我们将通过您在 GitHub 中提交的问题进行回复: https://github.com/box/box-ios-sdk/issues/117