Can someone one explain to me why this code doesn't work? I have no problem sending the elements of an array to NSLog but they don't seem to be appending to the string. Do I have to cast the array elements to a string?
success:^(NSURLRequest *request, NSHTTPURLResponse *response, id JSON) {
NSArray *dataarray=[JSON valueForKey:@"Data"];
NSLog(@"Response: %@", [JSON valueForKeyPath:@"Status"]);
NSString* output = [NSString stringWithFormat:@"response: %@",[JSON valueForKeyPath:@"Status"]];
int x;
for (x=0; x<[dataarray count]; x++) {
NSLog(@"%d : %@",x, [dataarray objectAtIndex:x]);
[output stringByAppendingFormat:@" %@ ",[dataarray objectAtIndex:x]];
}
//NSLog(@"%@", JSON);
NSLog(@"%@", output);
self.outPut2.text=output; }