Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/42.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 UIImageView类问题_Iphone_Objective C - Fatal编程技术网

Iphone UIImageView类问题

Iphone UIImageView类问题,iphone,objective-c,Iphone,Objective C,我拍摄了一个Imageview类,iam使用代码将图像添加到该类中: TileImageView*TileImageView=[[Tile alloc]initWithImage:TileImageView] 并像这样添加到视图中:[self.view insertSubview:tileImageView atIndex:0] 因此,如何删除Imageview类并将新图像分配到该视图中UIView类中有一个标记属性,可用于以后检索视图 titleImageView.tag = 1; [sel

我拍摄了一个Imageview类,iam使用代码将图像添加到该类中: TileImageView*TileImageView=[[Tile alloc]initWithImage:TileImageView]

并像这样添加到视图中:[self.view insertSubview:tileImageView atIndex:0]


因此,如何删除Imageview类并将新图像分配到该视图中

UIView类中有一个标记属性,可用于以后检索视图

titleImageView.tag = 1;

[self.view addSubview:titleImageView];

// later:

titleImageView = [self.view viewWithTag:1];
titleImage.view.image = otherImage;

或者,您可以将对图像视图的引用保存在实例变量中。

甚至没有注意到这一点。非常悲哀:22个问题被问到,大多数都有答案,没有人接受答案——这是我以前从未见过的!