Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 27th, 2012  |  syntax: None  |  size: 0.46 KB  |  hits: 9  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Synchronized access to UITableViewDelegate logic
  2. //condition = YES in init code
  3.  
  4.     - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
  5.     {
  6.         @synchronized( self)
  7.         {
  8.             if( !condition)
  9.             {
  10.                 NSLog(@"multiple execution is not allowed...");
  11.                 return;
  12.             }
  13.             condition = NO;
  14.             ...
  15.             //code
  16.             ...
  17.         }
  18.     }