iphone - Error when trying to shuffle an NSMutableArray -


I am trying to alter an NSMutableArray so that its order will be loaded with any view every time. << >> <<> - (zero) viewDidLoad I am putting the following code (as suggested by other users):

  NSMutableArray * shuffleTwo = [ Self .chosenTeamDict objectForKey: @ "Club"]; Int random = arc4random ()% [Shuffle two count]; For (Int i = 0; I & lt; [Shuffle two calculation]; I ++) {[Shuffle to exchange objectAut index: Object with endangered: i]; } NSLog (@ "% @", Shuffle Two);   

But when I do this and try to run the page, I get the following error:

  2012-07-09 18: 42: 16.126 kit quiz [6505: 907] (zero) libc ++ abi.dylib: an exception is called throwing ended   

Is there a new way of altering this array? Can recommend, or advise me how to avoid this error ..! I'm building for iOS 5 and I'm using Xcode45-DP1. thank you in advanced!

(edit)

I have also tried this method and I get the same error:

  NSMutableArray * shuffledArray = [[NSMutableArray alloc] init]; NSMutableArray * StandardAuthor = [auto. Chausenstadt Objectwork: @ "Club"]; For (int s = 0; s <[standardArray count]; s ++) {int random = arc4random ()% s; [ShuffledArray addObject: [standardOurObjectOntindex: Random]]; } NSLog (@ "% @", Shafed Array);  
  NSMutableArray * StandardArray = [self.chosenTeamDict objectForKey: @ "Club" ]; Int length = 10; // inch length = [count your arrays]; NSMutableArray * Index = [[NSMutableArray alloc] initWithCapacity: Length]; For (int i = 0; i   

^^ Answer

Comments