0
應用程序崩潰突然偶爾的方法 resetKeychainItem 在行210:崩潰在BOXKeychainItemWrapper.m
NSAssert(junk == noErr || junk == errSecItemNotFound, @"Problem deleting current dictionary.");
有什麼辦法避免這種崩潰/有任何更新,在這個問題上?
方法:
- (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];
}
}
}