Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/22.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/17.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 如何从标记中获取对象?_Iphone_Objective C - Fatal编程技术网

Iphone 如何从标记中获取对象?

Iphone 如何从标记中获取对象?,iphone,objective-c,Iphone,Objective C,我有一个视图。在该视图中,我有两个按钮 我知道那个按钮的标签。我想更改那个按钮的图像 如何通过此标签更改图像?按钮的超级视图。为什么不在文档中查找viewWithTag:? UIButton *button = (UIButton *)[myView viewWithTag:myTag]; [button setImage:... forState:...]; UIScrollView * scView=(UIScrollView*)[self.view viewWithTag:20]; UI

我有一个视图。在该视图中,我有两个按钮

我知道那个按钮的标签。我想更改那个按钮的图像


如何通过此标签更改图像?

按钮的超级视图。为什么不在文档中查找
viewWithTag:
UIButton *button = (UIButton *)[myView viewWithTag:myTag];
[button setImage:... forState:...];
UIScrollView * scView=(UIScrollView*)[self.view viewWithTag:20];
UIButton *button = (UIButton *)[scView viewWithTag:3];