-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtableController.m
More file actions
58 lines (48 loc) · 1.53 KB
/
Copy pathtableController.m
File metadata and controls
58 lines (48 loc) · 1.53 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
//
// tableController.m
// test7
//
// Created by Joosung Kim on 5/18/13.
// Copyright (c) 2013 Joosung Kim. All rights reserved.
//
#import "tableController.h"
@interface tableController ()
@end
@implementation tableController {
// Array for active activities
NSArray *activeAct;
}
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.
activeAct = [NSArray arrayWithObjects:@"test1",@"test2",@"test3", nil];
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return [activeAct count];
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *tableIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:tableIdentifier];
if(cell == nil){
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:tableIdentifier];
}
UILabel *activityName = (UILabel *)[cell viewWithTag:102];
activityName.text = [activeAct objectAtIndex:indexPath.row];
UILabel *activityTime = (UILabel *)[cell viewWithTag:103];
return cell;
}
@end