-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMatchsViewController.m
More file actions
81 lines (52 loc) · 2.02 KB
/
MatchsViewController.m
File metadata and controls
81 lines (52 loc) · 2.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
//
// MatchsViewController.m
// SportEvents
//
// Created by Джонни Диксон on 02.07.15.
// Copyright (c) 2015 Lavskiy Peter. All rights reserved.
//
#import "MatchsViewController.h"
#import "TFHpple.h"
#import "MatchCell.h"
#import "WorkWithData.h"
@interface MatchsViewController ()
@property (nonatomic , strong) NSArray * dataArray;
@end
@implementation MatchsViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.dataArray = [NSArray new];
[self loadMatchData];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return [self.dataArray count];
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
MatchCell * cell = [tableView dequeueReusableCellWithIdentifier:@"Cell"];
cell.lblOwnerTeam.text = [[self.dataArray objectAtIndex:indexPath.row] objectForKey:@"ownersName"];
cell.lblGuestTeam.text = [[self.dataArray objectAtIndex:indexPath.row] objectForKey:@"guestsName"];
cell.lblOwnerCount.text = [[self.dataArray objectAtIndex:indexPath.row] objectForKey:@"ownersCount"];
cell.lblGuestCount.text = [[self.dataArray objectAtIndex:indexPath.row] objectForKey:@"guestsCount"];
cell.lblTimeShow.text = [[self.dataArray objectAtIndex:indexPath.row] objectForKey:@"startTime"];
cell.lblStatus.text = [[self.dataArray objectAtIndex:indexPath.row] objectForKey:@"status"];
return cell;
}
-(NSString*) getDateToday
{
NSDate * dateToday = [NSDate date];
NSDateFormatter * dateFormat = [NSDateFormatter new];
[dateFormat setDateFormat:@"yyyy/MM/dd"];
NSString * date = [dateFormat stringFromDate:dateToday];
return date;
}
-(void)loadMatchData {
WorkWithData * work = [WorkWithData new];
NSString * date = [self getDateToday];
self.dataArray = [work loadMatchDataWithDate:date];
[self.matchTable reloadData];
}
@end