0

I can only access the id of my outlet collection and an id does not have a hidden property

This is my outlet collection

@property (strong, nonatomic) IBOutletCollection(UIImageView) NSArray *hearts;

and this is when I try to call it, and change it to hidden.

[self.hearts objectAtIndex:0].hidden =YES;

I can not because objectAtIndex only returns an id

Thanks for any help

4

1 回答 1

0

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

于 2014-07-25T00:45:45.443 回答