Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/120.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 将UIApgestureRecognitor添加到UILabel会导致以下错误:_Ios_Uitapgesturerecognizer - Fatal编程技术网

Ios 将UIApgestureRecognitor添加到UILabel会导致以下错误:

Ios 将UIApgestureRecognitor添加到UILabel会导致以下错误:,ios,uitapgesturerecognizer,Ios,Uitapgesturerecognizer,在iOS 5.0中,我尝试通过将gestureerecognizer从对象拖动到标签,将uitage添加到interface builder中的UILabel。但是,在UILabel的连接检查器中,IB显示错误消息,说明UILabel没有集合手势识别器。这是否意味着我只需要通过代码连接手势识别器 另外,我还启用了IB中UILabel上的用户交互 谢谢您在这方面的帮助。chk this。为什么不直接在代码中添加手势?[labelName.view AddGestureRecognitizer:Re

在iOS 5.0中,我尝试通过将
gestureerecognizer
从对象拖动到标签,将
uitage
添加到interface builder中的
UILabel
。但是,在
UILabel
的连接检查器中,IB显示错误消息,说明
UILabel
没有集合
手势识别器。这是否意味着我只需要通过代码连接
手势识别器

另外,我还启用了IB中
UILabel
上的用户交互


谢谢您在这方面的帮助。

chk this。为什么不直接在代码中添加手势?[labelName.view AddGestureRecognitizer:RecognitizerInstance]我正试图通过IB执行此操作。当通过IB为uilabel添加点击手势时,IB会给出错误消息,但允许在将用户交互设置为TRUE后添加和使用点击手势识别器。这很有趣,但它起作用了。你能展示一下你的IB文件的截图吗。很难理解你在哪里添加了什么。