我在推特上搜寻此代码的推文:
- (void)fetchTweets
{
NSURL *url = [NSURL URLWithString:@"http://search.twitter.com/search.json"];
NSDictionary *params = [NSDictionary dictionaryWithObject:@"#winning" forKey:@"q"];
TWRequest *request = [[TWRequest alloc] initWithURL:url
parameters:params
requestMethod:TWRequestMethodGET];
[request performRequestWithHandler:
^(NSData *responseData, NSHTTPURLResponse *urlResponse, NSError *error) {
if (responseData) {
NSError *jsonError;
tweets =
[NSJSONSerialization JSONObjectWithData:responseData
options:kNilOptions
error:&jsonError];
if (tweets) {
// NSLog(@"%@", tweets);
}
else {
NSLog(@"%@", jsonError);
}
}
[[self delegate] receivedTweets];
}];
[self performSelector:@selector(fetchTweets) withObject:nil afterDelay:30];
Twitter变数是国安局的变数,
NSDictionary *tweet = [[TwitterHandler sharedInstance].tweets objectAtIndex:indexPath.row];
我当然会收到JSON的推文, 但当我试图把它们添加到字典上时, 最终可以把它们放进一张表格,
我不知道为什么我得到这个,如果有任何帮助,我将不胜感激。