It looks like you're new here. If you want to get involved, click one of these buttons!
-(void) getUserTimeLine{
TWRequest *postRequest = [[TWRequest alloc] initWithURL:[NSURL URLWithString:@\"https://api.twitter.com/1/statuses/user_timeline.json?include_entities=true&include_rts=true&screen_name=USERNAME&count=1\"] parameters:nil requestMethod:TWRequestMethodGET];
[postRequest performRequestWithHandler:^(NSData *responseData, NSHTTPURLResponse *urlResponse, NSError *error) {
NSString *output;
if ([urlResponse statusCode] == 200) {
// Parse the responseData, which we asked to be in JSON format for this request, into an NSDictionary using NSJSONSerialization.
NSError *jsonParsingError = nil;
NSDictionary *publicTimeline = [NSJSONSerialization JSONObjectWithData:responseData options:0 error:&jsonParsingError];
output = [NSString stringWithFormat:@\"HTTP response status: %i\nPublic timeline:\n%@\", [urlResponse statusCode], publicTimeline];
NSString *json_string = [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding];
SBJsonParser *parser = [[SBJsonParser alloc] init];
[B] NSDictionary *myDict = [parser objectWithString:json_string error:nil];[/B]
[parser performSelectorOnMainThread:@selector(self) withObject:json_string waitUntilDone:YES];
}
else {
output = [NSString stringWithFormat:@\"HTTP response status: %i\n\", [urlResponse statusCode]];
}
[self performSelectorOnMainThread:@selector(displayText:) withObject:@\"Get My Timeline Done\" waitUntilDone:NO];
}];
}