Python can make a list with continuous numbers like this:
numbers=range(1,10); // >> [1,2,3,4,5,6,7,8,9]
How to implement this in Objective-c?
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.
Reading your statement ”
Just need an array with continuous numbers,I do not want to init it with a loop” lets me ask: what is more important for you: to have an
arrayor to have “something” that represents a continuous range of (natural) numbers. Have a look atNSIndexSetIt may come close to what you want. You initialize it withIterating over this set is as simple as iterating over an array and does not need NSNumbers.