[iOS] NSMutableArray 배열 순서 섞기 (랜덤으로 섞기) [Objective-c] for (int i=0; i < [arrTestA count]; i++) { int random = arc4random() % [arrTestA count]; [arrTestA exchangeObjectAtIndex:random withObjectAtIndex:i]; } 만약 특정 인덱스는 섞으면 안될 경우 아래 코드를 추가해주자. if (random == 5 || i == 5) { continue; } [Swift] extension Array { mutating func suffle() { if count < 2 { return } for i in 0 ..< (count - 1) { let j = Int(..