2010-08-25 4 views

Répondre

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

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

// insert item 
[newMutableArray addObject:randomItem]; 
+0

Merci beaucoup –

Questions connexes