Hi,
- (UITableViewCell *)tableView
UITableView *)ttableView cellForRowAtIndexPath
NSIndexPath *)indexPath{
// Temporary - should get all details from xml
static NSString *CellIdentifier = @"CellIdentifier";
// If a cell with this identifier is already created then it will be reused
UITableViewCell *cell = (UITableViewCell *)[ttableView dequeueReusableCellWithIdentifier:CellIdentifier];
if(cell==nil){
// If a cell with this identifier isn't already created then it will be created and assigned an identifier
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
UITextView *tmpTxtView = [[UITextView alloc] initWithFrame:CGRectMake(97, 30, 80, 40)];
[tmpTxtView setUserInteractionEnabled:NO];
[tmpTxtView setBackgroundColor:[UIColor clearColor]];
[tmpTxtView setTextColor:[UIColor whiteColor]];
[tmpTxtView setFont:[UIFont fontWithName
"Arial" size:16]];
[tmpTxtView setFont:[UIFont boldSystemFontOfSize:16]];
[tmpTxtView setTextAlignment:UITextAlignmentLeft];
[tmpTxtView setTag:kfeeTag];
[self setFee:tmpTxtView];
[tmpTxtView release];
[cell.contentView addSubview:fee];
}else{
fee = (UITextView *)[cell.contentView viewWithTag:kfeeTag]; // // Returns UIView instead of UITextView!
}
[fee setText
"A"];
return cell;
}
this line: fee = (UITextView *)[cell.contentView viewWithTag:kfeeTag];
returns a UIView instead of a UITextView and i don't understand why.
Thanks.
- (UITableViewCell *)tableView
// Temporary - should get all details from xml
static NSString *CellIdentifier = @"CellIdentifier";
// If a cell with this identifier is already created then it will be reused
UITableViewCell *cell = (UITableViewCell *)[ttableView dequeueReusableCellWithIdentifier:CellIdentifier];
if(cell==nil){
// If a cell with this identifier isn't already created then it will be created and assigned an identifier
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
UITextView *tmpTxtView = [[UITextView alloc] initWithFrame:CGRectMake(97, 30, 80, 40)];
[tmpTxtView setUserInteractionEnabled:NO];
[tmpTxtView setBackgroundColor:[UIColor clearColor]];
[tmpTxtView setTextColor:[UIColor whiteColor]];
[tmpTxtView setFont:[UIFont fontWithName
[tmpTxtView setFont:[UIFont boldSystemFontOfSize:16]];
[tmpTxtView setTextAlignment:UITextAlignmentLeft];
[tmpTxtView setTag:kfeeTag];
[self setFee:tmpTxtView];
[tmpTxtView release];
[cell.contentView addSubview:fee];
}else{
fee = (UITextView *)[cell.contentView viewWithTag:kfeeTag]; // // Returns UIView instead of UITextView!
}
[fee setText
return cell;
}
this line: fee = (UITextView *)[cell.contentView viewWithTag:kfeeTag];
returns a UIView instead of a UITextView and i don't understand why.
Thanks.