Search code examples
iphoneobjective-cviewsender

objective-c - re set sender tag after deleting


Is there a way to re set a sender tag like NSMutableArray does when you deleting an item ? My tag looks like : 1, 2, 3, 4... 20. When I'm deleting a view I want to retrieve the right order and not 1, 2, 4, 5... if I'm deleting the view number 3.

Thanks.


Solution

  • No. you will have to do it manually. Iterate subviews of parent view from the deleted view's tag.

    One more way is: If you are adding those views in a predefined order, you can use the index of subviews array.