本文介绍了ABPersonViewController CFRetain它的displayedPerson ABRecordRef?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
ABRecordRef addressBookRecord = ...;
ABNewPersonViewController *newPersonViewController = [[[ABNewPersonViewController alloc] init] autorelease];
newPersonViewController.newPersonViewDelegate = delegate;
newPersonViewController.displayedPerson = addressBookRecord;
是否安全
CFRelease(addressBookRecord);
?
是否有标准CoreFoundation
Is there a standard CoreFoundation pattern around this I'm not aware of?
推荐答案
我认为调用CFRelease是不安全的。
displayedPerson在标题中定义如下。
所以,显示的person只是分配,而不是复制或保留,当我们设置的值。
因此,我想我们可以' t释放它。
I don't think it's safe to call CFRelease.
displayedPerson is defined as follows in the header.
So, displayedPerson is just assigned and not copied or retained when we set the value.
Therefore, I think we can't release it.
@property(nonatomic, readwrite) ABRecordRef displayedPerson
这篇关于ABPersonViewController CFRetain它的displayedPerson ABRecordRef?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!