We're a community of 1.1M IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,080,642 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Twitter Trending Topics iPhone App

Hello
I previously created an iPhone app that displayed the top trending topics on Twitter. The user could drill down into the tweets about that topic before selecting an individual tweet that would launch the twitter page for that tweet displayed in an in app webpage. However Twitter has recently changed the trends API to incorporate Yahoo's Where On Earth ID (WOEID) and although I have updated the URL to the new JSON file, when I run the app in the simulator the table is empty. Any ideas why this is? Could it perhaps be because of the new JSON file with its new file name and format which includes events and query whereas the previous JSON file was using just URL and name?

Code:

#import "TrendViewController.h"
#import "CJSONDeserializer.h"
#import "TweetSearchViewController.h"


@implementation TrendViewController

@synthesize trendArray = _trendArray;
#pragma mark -
#pragma mark View lifecycle

#define kTwitterTrendURL @"http://api.twitter.com/1/trends/1.json"

-(void)loadTrends{
	NSURL *trendURL = [NSURL URLWithString:kTwitterTrendURL];
	NSError* theError = nil;
	NSData *trendData = [NSData dataWithContentsOfURL:trendURL];
	NSDictionary* jsonDict = [[CJSONDeserializer deserializer]
							  deserializeAsDictionary:trendData error:&theError];
	self.trendArray = [jsonDict objectForKey:@"trends"];
}


- (void)viewDidLoad {
    [super viewDidLoad];
	self.title=@"TwitterApp";
	[self loadTrends];
}
1
Contributor
0
Replies
1
View
dsmush
Light Poster
30 posts since Nov 2009
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page generated in 0.0662 seconds using 2.66MB