I am trying to get JSON data loaded from a NSURLConnection
delegate to send the array of objects back to the tableview that called it.
The delegate object is initialized with callback
to send back to
NSArray *returnArray;
ResultsTableRoot *callback;
JSON handling method
- (void)connectionDidFinishLoading:(NSURLConnection *)connection {
[connection release];
NSString *responseString = [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding];
[responseData release];
NSError *error;
SBJSON *json = [[SBJSON new] autorelease];
returnArray = [json objectWithString:responseString error:&error];
[responseString release];
//////////////////////////////////////////////
// Send data back to table view
[callback resultsArrayReciever:returnArray];
}
The array can't be accessed from here, the tableview I want to have the information, however the method is called
-(void)resultsArrayReciever:(NSArray *)array{
// Code executed
if(array){
// Code never executes, array isnt there
}
If you have a better way to go about this whole thing, it is more than welcome!!