1
我是很新,Objective-C的,所以我提前很抱歉,如果我失去了一些东西,你会考虑明显:)使用ABPersonViewController的正确方法?
我写了一个简单的程序来显示通讯簿,并选择用户(模仿iOS联系人列表)。
我有一个基本的控制器:
@interface BasicViewController :
UIViewController<ABPersonViewControllerDelegate>
控制器从先前视图临危一个ABRecordRef。 在我的方法之一,我用:
ABPersonViewController* ctrl = [[ABPersonViewController alloc]init];
ctrl.allowsEditing = NO;
[ctrl setPersonViewDelegate:self];
[ctrl setDisplaydPerson:person];
[self setView:ctrl.view];
[self.navigationController pushViewController:ctrl animated:
YES];
当我到了实际的看法,我得到了一个空白的屏幕(与一个ABPersonView相关背景)。 我拨弄了一下与displayedProperties:
ctrl.displayedProperties = [NSArray arraywithObjects:
[NSNumber numberWithInt:kABPersonLastNameProperty],nil];
当我指定我只是想看到最后的名字 - 消息出现 上了同样的观点 - NO_VALUE_UNKNOWN
我在调试检查,我ABRecordRef不为空,并包含所有相关的字符串。
任何想法?