Насколько я понимаю, мне нужно будет делегировать все твиты какому-то контроллеру TWTRTweetView, чтобы работаю над ними, но я не уверен, как это сделать, поскольку я в этом совершенно новичок. Я пытался прочитать документ, но не смог его понять, а большая часть примеров написана на Swift. Я также не уверен, как мне получить доступ к свойствам твита. Я пробовал STTwitter, где я играл с некоторыми текстами в формате JSON и где мне удалось получить текст и URL-адрес изображения, но я не могу понять, как сделать это напрямую с TwitterKit. Вот мой фактический код контроллера, отображающего временную шкалу:
Код: Выделить всё
#import "TwitterTimelineViewController.h"
#import
#import "AppDelegate.h"
@interface TwitterTimelineViewController ()
@property (strong, nonatomic) IBOutlet UITableView *TwitterTableView;
@end
@implementation TwitterTimelineViewController
TWTRUserTimelineDataSource *userTimelineDataSource;
- (void)viewDidLoad {
[super viewDidLoad];
AppDelegate *delegate=(AppDelegate *)[[UIApplication sharedApplication] delegate];
[[Twitter sharedInstance] startWithConsumerKey:@"myConsumerKey" consumerSecret:@"myConsumerSecretKey"];
TWTRAPIClient *APIClient = [[TWTRAPIClient alloc] init];
userTimelineDataSource = [[TWTRUserTimelineDataSource alloc] initWithScreenName:delegate.twitterUsername APIClient:APIClient];
self.dataSource = userTimelineDataSource;
}
- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary *)options {
return [[Twitter sharedInstance] application:app openURL:url options:options];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
Подробнее здесь: https://stackoverflow.com/questions/471 ... iewcontrol
Мобильная версия