I have an array of integers stored in a plist. I would to load them and do fast enumeration over the array. Is there a way to do this or does fast enumeration work only for objects?
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.
Fast enumeration do only work with objects in Obj-C.
However, if you stored integer values in a plist, you’ll have an
NSArrayor anNSDictionaryinstance representing that plist. TheNSArray/NSDictionaryworks with fast enumeration and will outputNSNumberswhen working with them, notint.That way, you can retrieve your
inteasily with[anNSNumber intValue].