Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "meta": {
- "code": 200
- },
- "response": {
- "deals": [
- {
- "id": 32373,
- "date_added": "2011-01-13 12:12:50",
- "end_date": "2011-01-14 10:00:00",
- "title": "$85 For $300 Babyface Facial At Park Avenue MedSpa",
- "yipit_title": "71% off Babyface Facial",
- "tags": [
- {
- "name": "Facial",
- "slug": "facial",
- "url": "http://yipit.com/new-york/deals/facial/"
- },
- {
- "name": "Spa",
- "slug": "spa",
- "url": "http://yipit.com/new-york/deals/spa/"
- }
- ],
- "source": {
- "name": "LivingSocial",
- "slug": "livingsocial",
- "paid": 0,
- "url": "http://yipit.com/new-york/livingsocial"
- }
- }
- ]
- }
- NSURL *url= [NSURL URLWithString:@"...url ...."];
- NSURLRequest *request=[NSURLRequest requestWithURL:url];
- AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc]initWithRequest:request];
- operation.responseSerializer= [AFJSONResponseSerializer serializer];
- [operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
- self.coursearray = [responseObject objectForKey:@"response"];
- NSLog(@"The Array: %@",self.coursearray);
- [self.tableView reloadData];
- } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
- NSLog(@"Request Failed: %@, %@", error, error.userInfo);
- }];
- [operation start];
- UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
- NSDictionary *tempdictionary=[self.coursearray objectAtIndex:indexPath.row];
- cell.textLabel.text=[tempdictionary objectForKey:@"title"];
- return cell;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement