Hi, I am working on my learning podcast for objective-c, and I'm not quite sure if this code will work. I'm trying to use fast enumeration to update an array of counters as an example.
This is the code that I came up with after researching it a bit, but I'm not sure if it's right or not. Can someone help me? It's the only thing holding me back from uploading my latest episode.
Code:
NSArray *array = [NSArray arrayWithObjects:
[NSNumber numberwithInt: 2],
[NSNumber numberwithInt: 1],
[NSNumber numberwithInt: 0],
nil;]
for (NSNumber *numberwithInt in array) {
if (numberwithInt > 0)
{
numberwithInt++
}
}
This is the code that I came up with after researching it a bit, but I'm not sure if it's right or not. Can someone help me? It's the only thing holding me back from uploading my latest episode.