Monotouch 中有没有办法从 IntPtr 获取 ABPerson 对象。我正在使用 ABPeoplePickerNavigationController 及其 ABPeoplePickerNavigationControllerDelegate。我必须在方法 ShouldContinue 中读取所选人员的一些属性。我的代码如下所示:
ABPeoplePickerNavigationController nc = new ABPeoplePickerNavigationController();
nc.Delegate = new CustomABPeoplePickerNavigationControllerDelegate();
我的自定义委托如下所示:
public class CustomABPeoplePickerNavigationControllerDelegate : ABPeoplePickerNavigationControllerDelegate
{
public override bool ShouldContinue (ABPeoplePickerNavigationController peoplePicker, IntPtr selectedPerson)
{
// *** HERE I HAVE TO GET ABPerson FROM IntPtr ***
peoplePicker.DismissModalViewControllerAnimated(false);
return true;
}
}