hey I want to make a demo of chat.so when I open UITableView for it, it should display from the last and previous item should be in upper side.. i.e., I want to scroll my UITableView to the last row automatically when user opens the chat screen. what should i do?
my code is-
cell = [tv dequeueReusableCellWithIdentifier:@"Cell"];
if (cell == nil)
{
cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:nil] autorelease];
}
[lblName setFont:[UIFont fontWithName:@"Arial" size:12]];
lblName.lineBreakMode = NSLineBreakByWordWrapping;
lblName.numberOfLines = 0;
lblName.text=[arrUsername objectAtIndex:indexPath.row];
lblName.textColor = [UIColor blackColor];
[lblName setBackgroundColor:[UIColor grayColor]];
if ([[arrCommentUid objectAtIndex:indexPath.row] isEqualToString:@"1"]) {
[lblName setTextAlignment:NSTextAlignmentLeft];
}
else
please help!! its the code for just optional.cell of UITableView