권말련의 게임 블로그
배열에 들어온 데이터를 랜덤으로 보여주고 싶을 때 쓰는 코드입니다. 배열에 있는 데이터를 랜덤으로 섞어 줍니다. index와 index를 서로 교체하는 방법이네요. for (int i=0; i < [photoitems count]; i++) { int random = arc4random() % [photoitems count]; [photoData exchangeObjectAtIndex:random withObjectAtIndex:i]; }