3madi 3madi - 1 year ago 85
iOS Question

Making squares disappear - iOS

I am planing to make an app for iPhone

I want to include some squares and assign a number to each square.

when a user taps on a square, it should disappear along with some other squares, for example:
If there are squares (1,2,3,4,5,6,7,8,9,10), the user selects 7 for example, so square number
7 should disappear along with all squares (square > 7) so the remaining squares must be

What is the best way to do this ?

Answer Source

You can create an NSArray of all the buttons and simply set the Alpha of the squares you wish to disappear.

Something like that:

  for(NSInteger i=0;i<squersArray;i++){
        [squersArray objectAtIndex:i].alpha = 0;


Good luck

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download