Hey guys,
So…. lets say I have an NSArray of images
NSMutableArray *images = [NSMutableArray new];
[images addObject:[UIImage imageNamed:@"line1.png"]];
[images addObject:[UIImage imageNamed:@"line2.png"]];
[images addObject:[UIImage imageNamed:@"line3.png"]];
[images addObject:[UIImage imageNamed:@"line4.png"]];
Now I would like to load all these at once using a for loop but here is the catch…. I need to be able to set the images as hidden until the user unhides through interaction.
for (UIImage *image in images) {
UIImageView *line = [[UIImageView alloc] initWithImage:image];
line.hidden = YES;
[self.view addSubview:line];
}
But then how to I set the hidden BOOL to NO using another method?
As a secondary question, how would one release *line in the code above?
Thanks,
Darren
One option is to set up your images like:
…and then to unhide them you can do:
…assuming that your user-interaction handler is able to determine what line in the UI the user is interacting with.