Twitter Trending Topics iPhone App


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?


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

@implementation TrendViewController

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

#define kTwitterTrendURL @""

	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 loadTrends];
Start New Discussion
View similar articles that have also been tagged: