0

I am developing a Twitter client for Mac OSX and I am using MgTwitter framework. I use xAuth login method and it works fine but I can't get tweets from my timeline.

Here is the error message in the console:

+[OARequestParameter requestParameter:value:]: unrecognized selector sent to class

And here is the code for login method and the functions to manage the token element:

- (void)startTwitter {
    NSLog(@"Starting twitter connection...");    
    NSString *consumerKey = @"***************";
    NSString *consumerSecret = @"*********";
    twitterEngine = [[MGTwitterEngine alloc] initWithDelegate:self];
    [twitterEngine setUsesSecureConnection:NO];
    [twitterEngine setConsumerKey:consumerKey secret:consumerSecret];
    [twitterEngine setUsername:user];
    // xAuth method
    [twitterEngine getXAuthAccessTokenForUsername:user password:password];
    // update timeline
    [self updateTwitterBuffer];
} // startTwitter

- (void) updateTwitterBuffer {
    NSLog(@"Updating timeline.");
    [twitterEngine getHomeTimelineSinceID:0 startingAtPage:0 count:20];
    [twitterEngine getDirectMessagesSinceID:0 startingAtPage:0];
    [twitterEngine getSentDirectMessagesSinceID:0 startingAtPage:0];
} // updateTwitterBuffer

- (void) stopTwitter {
    [twitterEngine release];
    [token release];
} // stopTwitter

- (void)accessTokenReceived:(OAToken *)aToken forRequest:(NSString *)connectionIdentifier {
    NSLog(@"Access token received! %@",aToken);
    token = [aToken retain];
    [twitterEngine setAccessToken:token];
}  // accessTokenReceived

I don't know where the error is. How can I solve it? Thanks a lot.

ib.
  • 27,830
  • 11
  • 80
  • 100
Tyflos
  • 1
  • 2

1 Answers1

0

It's extremely difficult to read your code above: it's jumbled. I'd recommend formatting it a bit.

Here's a link to a series that uses the MGTwitterEngine and takes you through using it step by step to create your own twitter application: http://brandontreb.com/creating-a-twitter-client-for-osx-part-1/

I'd recommend going through that to get a better understanding of how the library works.

John
  • 3,296
  • 2
  • 24
  • 36
  • Hello,
    thanks for the link. I knew this tutorial but it uses oAuth login method and I want to use xAuth. MgtwitterEngine supports xAuth but I don't understand the error message.
    – Tyflos Jun 01 '11 at 18:25
  • Hello
    I knew that tutorial but it uses oAuth login process and I want to use xAuth one. I don't understand the error message. I followed the demo app in MgTwitterEngine but I can connect to twitter but I can't get my timeline.

    Excuse me about the problems to read the source code. I'm blind and I can read it well. I rewrote it with HTML tags. I hope you can read it better now. Thanks a lot.

    – Tyflos Jun 01 '11 at 18:33