GoogleプレイスAPIを使用して近くの場所を検索しています。私は場所を取得するために1つの呼び出しを行い、場所の電話番号を取得する別の呼び出しを行います。 2番目の呼び出しは、アプリの速度を遅くしています。これはどうですか?いくつかのサンプルコードも提供できればそれは素晴らしいものです。2番目のAPI呼び出しがアプリの速度を遅くしています
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...
}
"サンプルコードを提供することができれば、" Show _your_ code。 – matt
ああ、ごめんなさい。今投稿しています –
バックグラウンドのスレッド/タスク/キューです。 – trojanfoe