Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #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];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement