错误“无法识别的选择器发送到实例"是什么意思?Xcode 中的意思 [英] What does the error "unrecognized selector sent to instance" mean in Xcode

查看:28
本文介绍了错误“无法识别的选择器发送到实例"是什么意思?Xcode 中的意思的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Xcode 中的unrecognized selector sent to instance" 是什么意思?

推荐答案

这意味着,方法未定义或相反,在错误的对象上调用方法.

It means, method is not defined or on the other-way, calling a method on the wrong object.

此错误的经典示例在选择器调用中缺少:".

classic example of this error is missing of ':' in selector call.

UIBarButtonItem *doneBtn = [[UIBarButtonItem alloc]
initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self
                action:@selector(DatePickerDoneClick)];

这里,

action:@selector(DatePickerDoneClick:)

预期而不是

action:@selector(DatePickerDoneClick)

这篇关于错误“无法识别的选择器发送到实例"是什么意思?Xcode 中的意思的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆