如何使用 Fabric api 显示来自特定用户时间轴的推文。这是我的代码,我试图在数组中加载 tweety 的 id,然后在表格视图中显示它们。
@implementation YourTweetViewController
- (void)viewDidLoad {
[super viewDidLoad];
[TwitterKit logInGuestWithCompletion:^(TWTRGuestSession *guestSession, NSError *error) {
if (guestSession) {
// Load tweets
__weak typeof(self) weakSelf = self;
NSArray *tweetIDs = @[@"20", // @jack's first Tweet
@"510908133917487104" // our favorite Bike tweet
];
[[[Twitter sharedInstance] APIClient] loadTweetsWithIDs:tweetIDs completion:^(NSArray *tweets, NSError *error) {
if (tweets) {
typeof(self) strongSelf = weakSelf;
strongSelf.tweets = tweets;
[strongSelf.tableView reloadData];
} else {
NSLog(@"Failed to load tweet: %@", [error localizedDescription]);
}
}];
} else {
NSLog(@"Unable to log in as guest: %@", [error localizedDescription]);
}
}];
}