我正在尝试使用以下代码段构建应用
我的界面定义是
@interface CreateMessageViewController : UIViewController
和我点击Button按钮的方法是
-(IBAction) handleEvents:(id) sender
{
if ((UIButton *) sender == openContact)
{
ABPeoplePickerNavigationController *picker = [[ABPeoplePickerNavigationController alloc] init];
picker.peoplePickerDelegate = self;
[self presentModalViewController:picker animated:YES];
[picker release];
}}
现在我收到picker.peoplePickerDelegate = self;
说
警告:类'CreateMessageViewController'未实现'ABPeoplePickerNavigationControllerDelegate'协议
我无法删除警告。请在这方面帮助我
任何形式的帮助都将受到高度赞赏
提前致谢!!
答案 0 :(得分:1)
peoplePickerDelegate
指定一些支持控制器类不支持的ABPeoplePickerNavigationControllerDelegate
协议的东西(如果对你来说不明显,则自己是你控制器的一个实例)。试试
@interface CreateMessageViewController : UIViewController <ABPeoplePickerNavigationControllerDelegate> {}
并实施相关信号