i am trying to add uitextview as subview of uitabaleview's cell and for that i am creating uitextview programatically in cellForRowAtIndex and i want it to be display the text dynamically from the nsmutablearray to uitextview however problem is ... how to differentiate for different uitextview of particular uitableview's cell. my code is in this way.......
- (UITableViewCell *)tableView:(UITableView *)tv
cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier=@"cell";
UITableViewCell *cell = [tv dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil)
{
cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease];
}
@try{
// Set up the cell...
if (tv == self.smsTableView) {
int count1=[smsTxt count];
int rowCount=indexPath.row;
int index1=(count1-(rowCount+1));
NSLog(@"count:::%d",count1);
NSLog(@"row count:::%d",rowCount);
NSString *cellValueSMSTxt = [self.smsTxt objectAtIndex:index1];
UITextView *msgView=[[UITextView alloc]init];
msgView.frame=CGRectMake(12, 15, 280, 45);
msgView.font=[UIFont systemFontOfSize:12.0];
msgView.editable=FALSE;
msgView.textColor=[UIColor grayColor];
msgView.backgroundColor=[UIColor clearColor];
msgView.text=cellValueSMSTxt;
arrMsgView=[[NSMutableArray alloc]init];
[arrMsgView addObject:msgView];
[msgView release];
UITextView *tempTextView=[arrMsgView objectAtIndex:rowCount];
NSLog(@"countforarr:::%d",[arrMsgView count]);
[cell.contentView addSubview:tempTextView];
[arrMsgView release];
}
}@catch (NSException *e) {
NSLog(@"%@",e);
}
cellForRowAtIndexPath:is called ?