我有以下代码。我对保留/释放概念不确定。
for (int i = 0; i < ABMultiValueGetCount(urls) ; i++) {
CFStringRef url = ABMultiValueCopyValueAtIndex(urls, i);
CFStringRef urlType = ABMultiValueCopyLabelAtIndex(urls, i);
urlString = (NSString *)url;
urlTypeString = (NSString *)urlType;
if ([urlTypeString hasPrefix:@"_"]) {
NSString * urlTypeSubString = [urlTypeString substringWithRange:NSMakeRange(4, ([urlTypeString length]-8))];
[mutableArray addObject:[NSString stringWithFormat:@"URL; %@: http://%@",urlTypeSubString,urlString]];
}else{
[mutableArray addObject:[NSString stringWithFormat:@"URL; %@: http://%@",urlTypeString,urlString]];
}
}
我有两个问题。
最佳答案
关于iphone - 在此代码中何处释放CFStringRef,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/9034982/