使用MGTwitterEngine获取搜索结果时遇到问题

时间:2010-04-19 14:49:57

标签: iphone objective-c twitter mgtwitterengine

我正在使用Matt Gemmell的MGTwitterEngine版本,我正在尝试从getSearchResultsForQuery方法获得一些结果。

// do a search
[_engine getSearchResultsForQuery:@"#quote"];

// delegate method for handling result
- (void)searchResultsReceived:(NSArray *)searchResults forRequest:(NSString *)connectionIdentifier
{
    if ([searchResults count] > 0)
    {
        NSDictionary *singleResult = [searchResults objectAtIndex:1];
    NSString *text = [singleResult valueForKey:@"text"]; 
        NSLog(@"Text at Index one: \n %@", text);
    }
}

但是,我似乎从来没有得到过结果。在控制台中,我得到:

Request 7E4C3097-88D6-45F1-90D2-AD8205FBAAC5 failed with error: Error Domain=HTTP Code=400 "Operation could not be completed. (HTTP error 400.)"

有解决方法吗?我是否正在实施委托方法? (另外,我很难为引擎安装YAJL的东西,并想知道这是否与它有关)

2 个答案:

答案 0 :(得分:1)

使用DEBUG常量等于1构建MGTwitterEngine,看一下finalURL给你的东西。在此处发布或使用http://apiwiki.twitter.com/Twitter-API-Documentation

确认其正确无误

答案 1 :(得分:0)

我明白了:

(gdb)po error-> _userInfo {     body =“<?xml version = \”1.0 \“encoding = \”UTF-8 \“?> \ n< hash> \ n
  < request> / oauth / access_token \ n
  < error>客户端应用程序不允许使用xAuth。< / error> \ n< / hash> \ n“;   response =< NSHTTPURLResponse:0x1c88b0&gt ;; }

您需要为您的应用程序请求xauth。

相关问题