Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/115.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 Outlet集合,我想访问UIimageview的属性(隐藏)_Ios_Uiimageview_Iboutletcollection - Fatal编程技术网

Ios Outlet集合,我想访问UIimageview的属性(隐藏)

Ios Outlet集合,我想访问UIimageview的属性(隐藏),ios,uiimageview,iboutletcollection,Ios,Uiimageview,Iboutletcollection,我只能访问我的outlet集合的id,并且id没有隐藏属性 这是我的零售店收藏 @property (strong, nonatomic) IBOutletCollection(UIImageView) NSArray *hearts; 这就是我试图调用它,并将其更改为隐藏的时候 [self.hearts objectAtIndex:0].hidden =YES; 我不能,因为objectAtIndex只返回一个id 感谢您的帮助您可以尝试枚举集合中的对象,使用您期望的类型,例如self.h

我只能访问我的outlet集合的id,并且id没有隐藏属性

这是我的零售店收藏

@property (strong, nonatomic) IBOutletCollection(UIImageView) NSArray *hearts;
这就是我试图调用它,并将其更改为隐藏的时候

[self.hearts objectAtIndex:0].hidden =YES;
我不能,因为objectAtIndex只返回一个id


感谢您的帮助

您可以尝试枚举集合中的对象,使用您期望的类型,例如self.hearts中的UIView*heartView,或者首先强制转换objectAtIndex:0,然后设置隐藏属性。

是的,我刚刚找到了它,我强制转换了它。谢谢你的帮助!