Did a search but cant seem to find exactly what I'm looking for Basically I load values into a nsmutablearray in one method and then I want to access these values in another method to print them to a table I declared the array in the app.h
NSMutableArray *clients;
Then in the app.m
- (void)connectionDidFinishLoading:(NSURLConnection *)connection {
[connection release];
NSString *responseString = [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding];
[responseData release];
NSArray *results = [responseString JSONValue];
clients = [[NSMutableArray alloc]init];
// Loop through each entry and add clients to array
for (NSDictionary *entry in results)
{
if (![clients containsObject:[entry objectForKey:@"client"]])
{
[clients addObject:[entry objectForKey:@"client"]];
}
}
}
Now Im try to acces the clients array in another method I have seen some suggestions to use extern in the app.h? Some sort of global variable?
Any help would be appreciated
Thanks