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

Untitled

By: a guest on May 4th, 2012  |  syntax: None  |  size: 0.29 KB  |  hits: 10  |  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. put random image on uibutton
  2. random()
  3.        
  4. -(void)randomizeArray:(NSMutableArray *)array
  5. {
  6.     int i, n = [array count];
  7.     for(i = 0; i < n; i++) {
  8.         int destinationIndex = random() % (n - i) + i;
  9.         [array exchangeObjectAtIndex:i withObjectAtIndex:destinationIndex];
  10.     }
  11. }