我是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/

10-12 06:28