Reputation: 185
I created UIImageViews and add it to subview. Then I add it to NSMutableArray.
So, I need delete from memory and subview object(UIImageView) in some index
[arr removeObjectAtIndex:index];
and
[arr replaceObjectAtIndex:index withObject:[NSNull null]];
don't help, because UIImageView doesn't disappear from View.
How to do this?
sorry for my English :)
Upvotes: 0
Views: 1378
Reputation: 6715
I would not prefer to add them to array, just give items tag value
[imageview setTag:index++];
. And you can get views with
[self viewWithTag:index];
and remove them
[[self viewWithTag:index] removeFromSuperView];
Upvotes: 0