English 中文(简体)
1. 设定人的财产
原标题:Setting person properties

Working on someone else s code. I am really confused about whats exactly happening in this code.

ABAddressBookRef addressBook = ABAddressBookCreate(); 
ABRecordRef persons = ABAddressBookGetPersonWithRecordID(addressBook, x);
CFErrorRef *error=NULL;
ABAddressBookRemoveRecord(addressBook, persons, error);
ABAddressBookSave(addressBook, error);

ABRecordRef persons = ABPersonCreate(); 

ABRecordSetValue(persons, kABPersonFirstNameProperty, firstName , nil);

应当做的是,应当设立一个上诉委员会。 他的财产应当确定,他的记录/细节应当展示。 他永远不能在地址簿中获救。 这样做是不是这样。 需要帮助。

Edit:除了将财产交给个人外,还增加了以下法典,以迫使观察控制者观看。

MyContactDetailViewcontroller *personContactDetail = [[MyContactDetailViewcontroller alloc] init];
personContactDetail.displayedPerson = persons; 
personContactDetail.passedSelectedContactData = selectedContactsOnlyData;
[self.navigationController pushViewController:personContactDetail animated:YES];
[personContactDetail release];

<代码>MyContactDetailView Controller 次流层。 或更适合使用<条码>无人知的密码<>。

您是否发现任何在书上重复接触的情况。

最佳回答

这正是这里发生的情况。 我将作解释。

<代码>ABaddressBookCreate > 创建新地址簿,从地址簿数据库中获取数据,因此对<代码>的任何改动。 ABAddressBook Ref只有当你打电话ABAddressBookSave(<>/code>时,才会被保存到实际的地址数据库中,这样,记录编号>>x>/code>的人就能够查阅。 诸位正在创建新的个人入境点。

ABRecordRef persons = ABPersonCreate(); 

并且不是你设定其价值,而是该特定物体可使用,除非你打电话......ABaddressBookSave(<>

希望能帮助你们......:

问题回答

暂无回答




相关问题
List Contents of Directory in a UITableView

I am trying to list the contents of Ringtones directory in a TableView, however, I am only getting the last file in the directory in ALL cells, instead of file per cell. This is my code: - (...

iPhone NSUserDefaults persistance difficulty

In my app i have a bunch of data i store in the NSUserdefaults. This information consists of an NSObject (Object1) with NSStrings and NSNumbers and also 2 instances of yet another object (Object2). ...

Writing a masked image to disk as a PNG file

Basically I m downloading images off of a webserver and then caching them to the disk, but before I do so I want to mask them. I m using the masking code everyone seems to point at which can be found ...

Resize UIImage with aspect ratio?

I m using this code to resize an image on the iPhone: CGRect screenRect = CGRectMake(0, 0, 320.0, 480.0); UIGraphicsBeginImageContext(screenRect.size); [value drawInRect:screenRect blendMode:...

Allowing interaction with a UIView under another UIView

Is there a simple way of allowing interaction with a button in a UIView that lies under another UIView - where there are no actual objects from the top UIView on top of the button? For instance, ...