I need to pick 32 distinctive objects from an NSMutableArray of 75 objects. it can be 1 to 32, 2 to 33 or 10 to 42. What functions should i use to get the new array? Sorry for being noob.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you want N consecutive objects from a random index, try the following:
If you need 32 random objects, you can extend this method to randomly sort the array: