Does ABPersonViewController CFRetain its displayedPerson ABRecordRef?

拥有回忆 提交于 2019-12-12 18:27:38

问题


ABRecordRef addressBookRecord = ...;
ABNewPersonViewController *newPersonViewController = [[[ABNewPersonViewController alloc] init] autorelease];
newPersonViewController.newPersonViewDelegate = delegate;
newPersonViewController.displayedPerson = addressBookRecord;

Is it safe to

CFRelease(addressBookRecord);

?

Is there a standard CoreFoundation pattern around this I'm not aware of?


回答1:


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


来源:https://stackoverflow.com/questions/2133020/does-abpersonviewcontroller-cfretain-its-displayedperson-abrecordref

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!