jeudi 4 mai 2017

How to split an array into multiple arrays randomly in objective-c

i have the following situation: I have a propertylist with an array with string elements like this [A,B,C,D,E,F,G,H,I,J,K,L,M,N,O] I will split this into x Arrays(x is the count of arrays which should be created randomly) and add this into the plist

For example x=4 and arraylength:15

PropertyList:

arrayAtIndex0[A,B,C,D,E,F,G,H,I,J,K,L,M,N,O]
arrayAtIndex0.1=[C,E,G,A]
arrayAtIndex0.2=[I,B,O,L]
arrayAtIndex0.3=[H,F,J,N]
arrayAtIndex0.4=[D,K,M]

Ho can i implement this as objective-c code ? Thx




Aucun commentaire:

Enregistrer un commentaire