gpt4 book ai didi

iphone - Foursquare iPhone API 附近的地方

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:07:16 24 4
gpt4 key购买 nike

我是 Foursquare API 的新手,我不知道如何根据当前位置找到附近的地点?我看了很多关于这个的样本,但我无法让它发挥作用。

最佳答案

请参阅此链接 https://github.com/Constantine-Fry/Foursquare-API-v2/tree/master/Foursquare2-iOS .很容易为 iPhone 集成 foursquare API。我用过这个。

例如:地点搜索

[Foursquare2 searchVenuesNearByLatitude:@"40.763" longitude:@"-73.990" accuracyLL:nil altitude:nil accuracyAlt:nil query:@"" limit:@"15" intent:@"" callback:^(BOOL success, id result){
if (success) {
//parse here
tableData = [[FoursquareParser parseSearchVenuesResultsDictionary:(NSDictionary*)result] retain];
[mTableView reloadData];
}
}];

//搜索 field 解析器

 +(NSMutableArray*)parseSearchVenuesResultsDictionary:(NSDictionary*)result{
NSArray *groupsArray = [[result objectForKey:@"response"] objectForKey:@"venues"];
if([groupsArray count] > 0){

NSMutableArray *resultArray = [NSMutableArray array];
//Get Stats details
NSDictionary *stats = [[groupsArray objectAtIndex:i] objectForKey:@"stats"];
[resultDictionary setObject:[stats objectForKey:@"checkinsCount"] forKey:@"checkinsCount"];
[resultDictionary setObject:[stats objectForKey:@"tipCount"] forKey:@"tipCount"];
[resultDictionary setObject:[stats objectForKey:@"usersCount"] forKey:@"usersCount"];

[resultArray addObject:resultDictionary];
return resultArray;
}
return [NSMutableArray array];
}

关于iphone - Foursquare iPhone API 附近的地方,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10910710/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com