tags:

views:

22

answers:

1

i have a problem i have an array which has ten items "one" to "ten" i want to get randon items from this array and put them in a new array which can display the random items

+2  A: 
// seed the random number generator    
srand([[NSDate date] timeIntervalSince1970]);

// get random item
NSObject *randomItem = [yourArray objectAtIndex:rand() % [yourArray count]];

// insert item
[newMutableArray addObject:randomItem];
MihaiD
thank u very much
pankaj kainthla