Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/39.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
Iphone UILabel文本+;苹果手机_Iphone_Ios_Uibutton_Uilabel - Fatal编程技术网

Iphone UILabel文本+;苹果手机

Iphone UILabel文本+;苹果手机,iphone,ios,uibutton,uilabel,Iphone,Ios,Uibutton,Uilabel,我想在我的应用程序中实现标记功能 标签中有一些文本,我想在其上显示ui按钮操作事件 我曾使用此代码检测ui标签中是否存在特定文本。 如何检查特定文本是否存在,以及是否给出了ui按钮操作事件 arr_count = {ABC,DEF,PQR}; FOR(int i = 0; i < [arr_Count]; i++) { Nsstring *Str_dec1; NSRange range = [Str_dec1 rangeOfString:[arr_count objectatind

我想在我的应用程序中实现标记功能

标签中有一些文本,我想在其上显示
ui按钮
操作事件

我曾使用此代码检测
ui标签中是否存在特定文本。
如何检查特定文本是否存在,以及是否给出了
ui按钮
操作事件

arr_count = {ABC,DEF,PQR};

FOR(int i = 0; i < [arr_Count]; i++) {
Nsstring *Str_dec1;
   NSRange range = [Str_dec1 rangeOfString:[arr_count objectatindex:i] options:NSCaseInsensitiveSearch];
   if (range.location != NSNotFound) {
       *******.....MISING CODE HERE......*****
   }
}
arr_count={ABC,DEF,PQR};
对于(int i=0;i<[arr_Count];i++){
Nsstring*Str_dec1;
NSRange range=[Str_dec1 rangeOfString:[arr_count objectatindex:i]选项:nscaseinsensitivisearch];
if(range.location!=NSNotFound){
*******…在这里输入错误代码*****
}
}
当我点击
UILabel
中的ABC或PQR或DEF文本时,我应该如何编码以使其显示
ui按钮
操作事件?

您只需调用

[self yourButtonActionMethod:nil];

您可以使用标签上的
uitagesturerecognizer
调用
UIButton
方法。或者你可以这样做:

 if(condition)
 {
     [self callButtonEvent:sender] // sender can be nil if you aren't passing anything
 } 

其中
条件
是当您检查标签的文本是否等于您想要的字符串时。

代码
[arr_Count;i++]
中,因为
块对我来说很奇怪(我承认,我不知道,所以我可能是错的)。方括号是如何工作的?我只想在标签中特定文本区域的用户选项卡上调用该方法。若要检测XYZ是否到达标签中的特定区域,请执行以下操作: