-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDatetimeCell.m
executable file
·77 lines (58 loc) · 1.78 KB
/
DatetimeCell.m
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
//
// DatetimeCell.m
// TradeShowInfo
//
// Created by Elon on 4/18/11.
// Copyright 2011 __MyCompanyName__. All rights reserved.
//
#import "DatetimeCell.h"
@implementation DatetimeCell
@synthesize myTaleView,datetimeCell;
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
// Initialization code.
}
return self;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state.
}
- (void)dealloc {
[datetimeCell release];
[self.myTaleView release];
[super dealloc];
}
- (void)layoutSubviews {
[super layoutSubviews];// x,y,w,h layout from IB design for xib
myTaleView.backgroundColor=[Constants backgroundColor];
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
return 1;
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return 1;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
static NSString *CellIdentifier = @"DatetimeCell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if(indexPath.section==0) {
if (datetimeCell == nil) {
NSArray *array=[[NSBundle mainBundle] loadNibNamed:@"StarsEndsCell" // not StarsEndsCell
owner:self
options:nil];
cell=[array objectAtIndex:0];
datetimeCell = (StarsEndsCell *)cell;
[datetimeCell retain];
}else {
cell = datetimeCell;
}
return cell;
}
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
return 44.0;
}
@end