我正在实现
- (BOOL)personViewController:(ABPersonViewController *)personViewController shouldPerformDefaultActionForPerson:(ABRecordRef)person property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifier委托在我的自定义类中,它是ABPersonViewController的子类。委托方法捕获ABPersonViewController子类中的单击事件。但是我怎么知道哪个字段被点击了呢?例如。如果我单击家庭地址字段,我将如何处理委托方法中的这种情况。
发布于 2012-05-01 16:20:58
- (BOOL)personViewController:(ABPersonViewController *)personViewController shouldPerformDefaultActionForPerson:(ABRecordRef)person property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifier{
if(property == kABPersonAddressProperty){
ABMutableMultiValueRef multi = ABRecordCopyValue(person, property);
CFStringRef address = ABMultiValueCopyValueAtIndex(multi, identifier);
NSLog(@"Address %@", (NSString *)address);
// Do your tasks here
CFRelease(address);
}
return YES;
}就像kABPersonAddressProperty一样,你可以查看所有其他的属性,如电话号码,电子邮件,网址等。
https://stackoverflow.com/questions/10394637
复制相似问题