Ich benutze Google Orte API, um nach Orten in der Nähe zu suchen. Ich mache einen Anruf, um die Plätze zu bekommen, und einen weiteren Anruf, um die Telefonnummer der Orte zu bekommen. Der zweite Anruf verlangsamt die App. Irgendwie in der Nähe? Wenn auch ein Beispielcode bereitgestellt werden könnte, wäre das großartig.Second Api Anruf verlangsamt App iOS
s1 = [NSString stringWithFormat:@"https://api.foursquare.com/v2/venues/explore?client_id=%@&client_secret=%@&query=%@&v=20201212&m=swarm&sortByDistance=%i&radius=%f&limit=%@&ll=%f,%f", kClientID, kClientSecret, Name, sortByDistance, meterRadius, recorddisplay, lat, lng];
NSLog(@"This is the foursqaure query: %@", s1);
NSURL *jsonURL = [NSURL URLWithString:[self urlEncodeValue:s1]];
NSString *jsonDataString = [[NSString alloc]initWithContentsOfURL:jsonURL];
NSData *jsonData = [jsonDataString dataUsingEncoding:NSUTF8StringEncoding];
//NSLog(@"This is JSON data: %@", jsonDataString);
if(jsonData == nil)
{
NSLog(@"SEARCH RESULT IS NIL.....");
//[pool release];
return FALSE;
}
else
{
//retrieve the objects in the JSON and then make another http request...
}
"Wenn auch ein Beispielcode zur Verfügung gestellt werden könnte, wäre das großartig" Zeige _Ihr_Code. – matt
Oh yea sorry Posting jetzt –
In einem Hintergrund thread/task/queue. – trojanfoe