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
views:
22answers:
1
+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
2010-08-25 07:14:58
thank u very much
pankaj kainthla
2010-08-26 04:54:52