Advertisement
Guest User

Untitled

a guest
Oct 20th, 2014
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -(IBAction)UserTapButtonsOption:(UIButton*)sender
  2. {
  3.     UIButton *btn=(UIButton *)sender;
  4.     NSIndexPath *indexPath=[NSIndexPath indexPathForRow:btn.tag inSection:0];
  5.    
  6.     NSLog(@"%ld%ld",(long)indexPath.row,(long)sender.tag);
  7.  
  8.     if (indexPath.row == sender.tag) {
  9.            
  10.     sender.selected=!sender.selected;
  11.    
  12.     if(sender.selected)
  13.     {
  14.         sender.backgroundColor = [UIColor yellowColor];
  15.        
  16.     }
  17.     else {
  18.         sender.backgroundColor = [UIColor redColor];
  19.  
  20.         }
  21.     }
  22.    
  23.     else if (indexPath.row != sender.tag) {
  24.         return;
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement