App在方法中偶尔会突然崩溃 的 resetKeychainItem 在第210行:
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];
}
}
}