Hello,
The following example prints out the result line by line in the loop. How can i append the result of each line and print it outside the while loop? Thank you
Produces:
thisObject: One
thisObject: Two
thisObject: Three
The following example prints out the result line by line in the loop. How can i append the result of each line and print it outside the while loop? Thank you
PHP:
NSArray * myArray = [NSArray arrayWithObjects:@"One", @"Two", @"Three", nil];
NSEnumerator * myArrayEnumerator = [myArray objectEnumerator];
NSString *thisObject;
while (thisObject = [myArrayEnumerator nextObject])
{
NSLog(@"thisObject: %@", thisObject);
}
// NSLog(@"Using while loop and I would like the result
// outside the loop so: thisObject: One Two Three");
Produces:
thisObject: One
thisObject: Two
thisObject: Three