Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Twitter Trending App

By: a guest on Mar 8th, 2012  |  syntax: Objective C  |  size: 0.74 KB  |  views: 15  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
This paste has a previous version, view the difference. Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #import "TrendViewController.h"
  2. #import "CJSONDeserializer.h"
  3. #import "TweetSearchViewController.h"
  4.  
  5.  
  6. @implementation TrendViewController
  7.  
  8. @synthesize trendArray = _trendArray;
  9. #pragma mark -
  10. #pragma mark View lifecycle
  11.  
  12. #define kTwitterTrendURL @"http://api.twitter.com/1/trends/1.json"
  13.  
  14. -(void)loadTrends{
  15.         NSURL *trendURL = [NSURL URLWithString:kTwitterTrendURL];
  16.         NSError* theError = nil;
  17.         NSData *trendData = [NSData dataWithContentsOfURL:trendURL];
  18.         NSDictionary* jsonDict = [[CJSONDeserializer deserializer]
  19.                                                           deserializeAsDictionary:trendData error:&theError];
  20.         self.trendArray = [jsonDict objectForKey:@"trends"];
  21. }
  22.  
  23.  
  24. - (void)viewDidLoad {
  25.     [super viewDidLoad];
  26.         self.title=@"TwitterApp";
  27.         [self loadTrends];
  28. }
clone this paste RAW Paste Data