作者热门文章
- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
我需要从我的 Cocoa 应用程序访问选定人员的电子邮件。我已将 ABPeoplePickerView 放在主窗口上,并通过 [peoplePicker selectedRecords]
获得了选定人员的列表。如何访问 ABPerson
对象的电子邮件字段?
最佳答案
-(BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker
shouldContinueAfterSelectingPerson:(ABRecordRef)person
property:(ABPropertyID)property
identifier:(ABMultiValueIdentifier)identifier
{
NSString *email = nil;
ABMultiValueRef emails = ABRecordCopyValue(person, kABPersonEmailProperty);
if(emails){
email = (NSString *) ABMultiValueCopyValueAtIndex(emails,0);
[email autorelease];
}
[self dismissModalViewControllerAnimated:YES];
emaillabel.text = email;
return YES;
}
关于objective-c - 如何从 ABPeoplePickerView 中的选定 ABPerson 获取电子邮件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5129749/
我到处寻找,希望有人能给我指出正确的方向。 我只想在每次用户选择不同的记录时运行一个方法。 更大的图景(如果有替代方法)是,当用户选择记录(单击)时,该人的电话号码将被放入分段控件中。 我已经尝试过:
我在 Mac OS X 应用程序中使用 ABPeoplePicker。我连接了一个按钮,将所选记录更改为默认的“我”记录。 这工作正常,并且记录被选中,但是,我需要滚动表格才能看到所选的记录。 NST
我需要从我的 Cocoa 应用程序访问选定人员的电子邮件。我已将 ABPeoplePickerView 放在主窗口上,并通过 [peoplePicker selectedRecords] 获得了选定人
我是一名优秀的程序员,十分优秀!