I am using MGTwitterEngine + OAuth in my project. I would like to load all tweets from the currently logged in user into a NSMutableArray, however I am having difficulty doing so.
Upon successful login I call the following method:
[_engine getUserTimelineFor:_engine.username sinceID:0 startingAtPage:0 count:20];
And then in the delegate method I have the following:
- (void) statusesReceived:(NSArray *)statuses
forRequest:(NSString *) connectionIdentifier
{
for ( NSDictionary *dict in statuses )
{
NSLog(@"%@", [dict objectForKey:@"id" ]);
// tweets is a NSMutableArray previously allocated and initialised
[tweets addObject:[dict objectForKey:@"id" ]];
}
[_engine getUserTimelineFor:_engine.username sinceID:0 startingAtPage:0 count:20];
}
As you can see I am attempting to batch load the current users tweets, 20 at a time.
I believe the issue lies in the fact, I am not incrementing the page parameter. My issue is, I don't understand what a page actually represents, or how to get the total number of pages for any given user.
How can I load all of a users tweets in a simple, and efficient manner?