iOS Twitter Streaming API用于在所需位置获取公共推文

时间:2015-07-07 21:00:07

标签: ios twitter

我是Twitter Streaming API的新手!

目前我正在尝试实施Twitter Streaming API以获取所需位置的公开信息:

- (void)test
{
        NSURL *url = [NSURL URLWithString:@"https://stream.twitter.com/1.1/statuses/sample.json"];

        SLRequest *request  = [SLRequest requestForServiceType:SLServiceTypeTwitter requestMethod:SLRequestMethodGET URL:url parameters:nil];


        NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:[request preparedURLRequest] delegate:self startImmediately:NO];

        [connection scheduleInRunLoop:[NSRunLoop mainRunLoop] forMode:NSDefaultRunLoopMode];

        [connection start];
}

在NSURLConnectionDelegate回调didReceiveData:我总是得到null响应。我的问题在哪里?如何使它工作?

0 个答案:

没有答案