Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/93.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone Foursquare iOS API_Iphone_Ios_Api_Foursquare - Fatal编程技术网

Iphone Foursquare iOS API

Iphone Foursquare iOS API,iphone,ios,api,foursquare,Iphone,Ios,Api,Foursquare,我是一名新手,正在尝试了解如何修改Foursquare iOS API“BZFoursquare”: 在他们的示例中,他们使用了一体式ViewController。不过,我将有多个ViewController,因此希望有一个带有常用代码的AppController。在ios5下,我需要如何执行此操作 谢谢您的帮助。请查看此链接。为iPhone集成foursquare API很容易 你好,马可, 将Foursquare2文件夹添加到项目中,并在视图控制器中检查身份验证。请参阅下面的代码。这会对你有

我是一名新手,正在尝试了解如何修改Foursquare iOS API“BZFoursquare”: 在他们的示例中,他们使用了一体式ViewController。不过,我将有多个ViewController,因此希望有一个带有常用代码的AppController。在ios5下,我需要如何执行此操作

谢谢您的帮助。

请查看此链接。为iPhone集成foursquare API很容易

你好,马可, 将Foursquare2文件夹添加到项目中,并在视图控制器中检查身份验证。请参阅下面的代码。这会对你有帮助的

- (void)viewDidLoad
{
    [super viewDidLoad];

    self.title = @"Foursquare";
    //check the authentication
    if ([Foursquare2 isNeedToAuthorize]) {
       //If needed show the webview 
        webView = [[UIWebView alloc]initWithFrame:CGRectMake(0, 0, 320, 480)];
        NSString *url = [NSString stringWithFormat:@"https://foursquare.com/oauth2/authenticate?display=touch&client_id=%@&response_type=code&redirect_uri=%@",OAUTH_KEY,REDIRECT_URL];
        NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:url]];
        [webView loadRequest:request];
        [webView setDelegate:self];
        [self.view addSubview:webView];
        [webView release];
        mTableView.hidden = YES;
    }else{
        //Show your view
        mTableView.hidden = NO;
        [Foursquare2 searchVenuesNearByLatitude:@"40.763" longitude:@"-73.990" accuracyLL:nil altitude:nil accuracyAlt:nil query:@"" limit:@"15" intent:@"" callback:^(BOOL success, id result){
            if (success) {

                tableData = [[FoursquareParser parseSearchVenuesResultsDictionary:(NSDictionary*)result] retain];
                [mTableView reloadData];

            }
        }];

    }
}

您还可以使用oAuth登录foursquare,因为它非常容易实现。在OAuth2.0中,您必须获得访问令牌,并且使用该访问令牌可以获得用户详细信息,如朋友和个人资料信息。oAuth是两步验证方法,要详细实现,因为您是新手,所以我为您找到了一个很好的教程,

如果我想使用故事板(SDK 4.1),我需要如何集成此API?