0
我嘗試使用來自iOS and Keychain Migration and Data Protection - Part 3的UYLPasswordManager,並在分析[結果發佈]代碼行中存在對象的潛在泄漏時收到警告。這是一個真正的潛在泄漏?如果是的話,我該如何解決它?如果不是,我該如何沉默警告?我的項目使用ARC,但我用UYLPasswordManager對象的標誌關閉了它。UYLPasswordManager中對象的潛在泄漏
- (void)searchKeychain {
if (self.keychainValue == nil) {
NSMutableDictionary *searchDictionary = [self newSearchDictionary];
[searchDictionary setObject:(id)kSecMatchLimitOne
forKey:(id)kSecMatchLimit];
[searchDictionary setObject:(id)kCFBooleanTrue
forKey:(id)kSecReturnData];
NSData *result = nil;
OSStatus status = SecItemCopyMatching((CFDictionaryRef)searchDictionary,
(CFTypeRef *)&result);
[searchDictionary release];
if (result) {
self.keychainValue = [[NSString alloc] initWithData:result
encoding:NSUTF8StringEncoding];
[result release];
}
}
}