为 ABPeoplePickerNavigationController 设置委托时收到警告
我正在尝试使用以下代码片段构建一个应用程序
我的界面定义是,
@interface CreateMessageViewController : UIViewController
并且我作为按钮单击结果调用的方法是
-(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”协议
我无法删除该警告。请在这方面帮助我
任何类型的帮助将不胜感激
提前致谢!
I am trying to build an app with the following code snippets
My Interface definition is
@interface CreateMessageViewController : UIViewController
and the method I am calling as result of Button click is
-(IBAction) handleEvents:(id) sender
{
if ((UIButton *) sender == openContact)
{
ABPeoplePickerNavigationController *picker = [[ABPeoplePickerNavigationController alloc] init];
picker.peoplePickerDelegate = self;
[self presentModalViewController:picker animated:YES];
[picker release];
}}
Now I am getting a warning for picker.peoplePickerDelegate = self;
saying
warning: class 'CreateMessageViewController' does not implement the 'ABPeoplePickerNavigationControllerDelegate' protocol
I am not able to remove the warning. Please help me out in this regard
Any kind of help would be highly appreciated
Thanks in advance!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
需要为
peoplePickerDelegate
分配支持ABPeoplePickerNavigationControllerDelegate
协议的内容,而您的控制器类不支持该协议(self 是控制器的实例,以防您不明显)。尝试并实施相关信号
peoplePickerDelegate
needs to be assigned something that supports theABPeoplePickerNavigationControllerDelegate
protocol which your controller class doesn't (self is an instance of you controller in case that was not obvious to you). Tryand implement the relevant signals