I saw some documentation and previous questions about this, but couln’t find a solution. My code looks like:
for(NSString str : NSArray){
NSLog(str);
}
The error is at the :
Thanks in advance.
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.
I think you want something along the lines of the following:
Note the different syntax for the loop, and using the array object, not the class name there. You can read about fast enumeration in the documentation.