Advertise here




Advertise here

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Google Sign In with OpenID
Please do not post the same thing multiple times. The board software automatically flags certain posts as needing moderator attention. This happens the most often for new users. I'm pretty sure this is made clear at the time you attempt to post. Posting the same thing over and over again just makes that many more posts the moderators have to weed through later. This makes us sad. Don't make us sad. If your post/thread doesn't appear, just wait a while. Don't post it again. If it hasn't shown up by the next day, then you can try again. I normally go through posts in the mornings, and try to check a few times throughout the day, but I'm not here 24/7. There will typically be a significant delay before posts are approved. Just be patient.

StoryBoard Tableview passing data

Hey all,

I want to use the Twitter framework + some tableview to show data.
1) click button to get 2 last posting
2) use a segue to show the raw data
3) use navigation bar to return to tabbars...

I have the storyboard design in the picture attached

here's the problem:
The segue is being called before the post request is processed (that's what I deduced from debugging the code)! (in essence the dictionary has no data as the segue is called!!!

PS: the twitter code comes out of the twitter framework sample and SBJson...

any chance someone has played with the xcode4.2 to help me understand how to slow or make the call in another way??

-(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];
}];

}
Screen shot 2011-10-20 at 11.50.51 AM.jpg
1 x 1 - 11K
Sign In or Register to comment.