I’m trying to iterate through an NSArray and keep getting a compiler error right when i try concatenating the contents of my array at position i to my NSMutableString instance..
It just tells me that there’s a ‘syntax error before ;’ which doesn’t tell me a whole lot. at this line:
[output appendString:[widget.children objectAtIndex:i];
i know there must be something up with my syntax..
my function is as follows
- (NSString *)readArray { NSMutableString *output = [[NSMutableString alloc] init]; int i; int arraySize = widget.children.count; NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; for (i = 0; i < arraySize; i++) { [output appendString:[widget.children objectAtIndex:i]; (throws error here) } [pool release]; return output; }
thanks in advance
you have an unclosed bracket
you need
]]at the end instead of]