Possible Duplicate:
canonical way to randomize an NSArray in Objective-C
Suppose I have an array as follows.
shuffleArray = [[NSMutableArray alloc] initWithObjects:@"A",@"B",@"C",@"D",@"E", nil];
and I want to change the position of elements of the array randomly as follows:
shuffleArray = [[NSMutableArray alloc] initWithObjects:@"C",@"A",@"B",@"E",@"D", nil];
then how can I do this?