开发者

Twitter in iPhone

开发者 https://www.devze.com 2023-03-30 21:10 出处:网络
I am integrating twitter api(OAuth+MGTwitter). I am able to login and get all the tweets of all people followed by me. Now I want to get tweets only from one account(people). How can I get all the twe

I am integrating twitter api(OAuth+MGTwitter). I am able to login and get all the tweets of all people followed by me. Now I want to get tweets only from one account(people). How can I get all the tweets by somebody ?

Description: Suppose I want to see only @XXX_123's tweets.

Code : `

#pragma mark UITableViewDataSource Methods 

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {

    return [tweets count];
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    NSString *identifier = @"cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier];

    if(!cell) {

        cell = [[UITableViewCell alloc] initWithStyle:UITableViewStyleGrouped reuseIdentifier:identifier];
        //[cell setBackgroundColor:[UIColor clearColor]];
    开发者_运维技巧}

    [cell.textLabel setNumberOfLines:7];
    [cell.textLabel setText:[(Tweet*)[tweets objectAtIndex:indexPath.row] tweet]];

    return cell;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {

    return 150;
}

`

Regards!!


You have to use the various methods provided my MGTwitter to get various results. For getting tweets of a particular person

twitterEngine = [[MGTwitterEngine alloc] initWithDelegate:self];
[twitterEngine getUserTimelineFor:username sinceID:0 startingAtPage:0 count:15];

Where username is the user you want to retrieve the tweets of

0

精彩评论

暂无评论...
验证码 换一张
取 消