Is the best way of doing what i'm doing? goodThingX
, badThingX
and nothin
are UILabels.
NSString *todayNothing = [[todayArray objectAtIndex:0] objectForKey: @"nothing"];
if (todayNothing!=NULL) {
goodThing1.hidden = YES;
goodThing2.hidden = YES;
goodThing3.hidden = YES;
badThing1.hidden = YES;
badThing2.hidden = YES;
badThing3.hidden = YES;
nothing.text = todayNothing;
nothing.hidden = NO;
} else {
goodThing1.hidden = NO;
goodThing2.hidden = NO;
goodThing3.hidden = NO;
badThing1.hidden = NO;
badThing2.hidden = NO;
badThing3.hidden = NO;
nothing.hidden = YES;
}
i.e. When the the todayNothing
has some text, I want to hide 6 labels, and display the nothing
label, else the opposite. I woudn't have bothered to optimize this, but probably there are going to be more labels than the 6 right now..