Hello,
I'm using an NSArray of images, and each image has a tag. I want to know how to retrieve these images from the array using their tags.
Any input would be appreciated. Thanks.
Hello,
I'm using an NSArray of images, and each image has a tag. I want to know how to retrieve these images from the array using their tags.
Any input would be appreciated. Thanks.
- (UIImage *)imageFromArray:(NSArray *)array withTag:(NSInteger)tag {
for (UIImage *image in array) {
if ([image tag] == tag)
return image;
}
return nil;
}
Completely untested, though.