Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 10-20-2011, 11:12 AM   #1 (permalink)
Registered Member
 
Join Date: Aug 2009
Posts: 4
WashFL is on a distinguished road
Default 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??

Code:
-(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];
            
           NSDictionary *myDict = [parser objectWithString:json_string  error:nil];
            
        [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];
	}];
    
}
Attached Images
File Type: jpg Screen shot 2011-10-20 at 11.50.51 AM.jpg (11.0 KB, 7 views)
WashFL is offline   Reply With Quote
Reply

Bookmarks

Tags
storyboard, twitter, twitter api, twitter table cell

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 399
14 members and 385 guests
13dario13, 7twenty7, buggen, EvilElf, glenn_sayers, j.b.rajesh@gmail.com, LunarMoon, morterbaher, n00b, QuantumDoja, sacha1996, Sami Gh, VinceYuan
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,673
Threads: 94,122
Posts: 402,906
Top Poster: BrianSlick (7,990)
Welcome to our newest member, morterbaher
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 05:27 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0