Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to hide a bunch of labels in an IBOutletCollection?

New to Objective-C and iOS development, would love a hand here!

I have written up some code such that

IBOutletCollection(UILabel) NSArray *allLabels;

In IB I have linked up all my labels in my view to this collection, where I want to hide them for a certain condition. However, I am not sure how to do so. Obviously to hide a single label I'd use

labelX.hidden = YES;

however it is not ideal for me to do this without a collection, as I have many labels to hide.

Thanks for your tips in advance!

like image 316
Ben T Avatar asked May 28 '12 07:05

Ben T


1 Answers

try this...

[allLabels setValue:@(YES) forKey:@"hidden"];
like image 81
Ankit Srivastava Avatar answered Sep 22 '22 01:09

Ankit Srivastava