Data type for removeFromSuperview
Hey again,
This may sound weird but I am trying to do this
for (int x = 1; x < randomNumber; x++) {
NSString *result = [NSString stringWithFormat:@"image%d", x];
NSLog(@"%@", result);
[result removeFromSubview]; //getting NSString may not respond to 'removeFromSubview'
}
this is listing all of the images I have added to my view. I'm trying to remove them by name using this but I can not use an NSString so what data type can I convert this to in order to use
[result removeFromSubview];
?
I hope that makes sense, the reason I am doing it this way is because there is a random number of images added so I never know how many to remove.
|