views:

411

answers:

1

I am attempting to use the TouchXML library and followed the example with the following code

for (CXMLElement node in nodes) {
            NSMutableDictionary *item = [[NSMutableDictionary alloc] init];
            int counter;
            for (counter = 0; counter < [node childCount]; counter++ ) {
                [item setObject:[[node childAtIndex:counter] stringValue] forKey:[[node childAtIndex:counter] name]];
            }

            [rst addObject:item];
            [item release];

        }

The compiler however is complaining about counter and throwing the following error for counter = 0 and both occurances in the setObject call.

Cannot convert to pointer type

Any help with my rusty C/ObjC would be appreciated

+2  A: 

My bad, had nothing to do with counter, rather this...

for (CXMLElement node in nodes) {

node needs to be declared as a pointer like so...

for (CXMLElement *node in nodes) {
Flash84x