Note that there are some explanatory texts on larger screens.

plurals
  1. POweird behavior in tableview iphone
    primarykey
    data
    text
    <p>This is kind of weird. I have a table view in my app which is showing fetched data from the database. If i scroll down and select a cell the text would change and a line of text from some previous cell will be placed above the current selected cell's text. I know this might be due to the reuseIdentifier, but i have no idea how to fix that. Here's the code i'm using: </p> <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { UILabel* labelCourse; UILabel* labelPlace; static NSString *kCellID = @"cellID"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:kCellID]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:kCellID] autorelease]; cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; } Course *course = nil; if (tableView == self.searchDisplayController.searchResultsTableView) { course = [self.filteredListContent objectAtIndex:indexPath.row]; } else { course = [self.courses objectAtIndex:indexPath.row]; } CGRect labelCourseFrame = CGRectMake(10, 10, 290, 25); labelCourse = [[UILabel alloc] initWithFrame:labelCourseFrame]; labelCourse.font = [UIFont systemFontOfSize:14.0]; labelCourse.font = [UIFont boldSystemFontOfSize:18]; [cell.contentView addSubview:labelCourse]; CGRect labelPlaceFrame = CGRectMake(10, 35, 290, 25); labelPlace = [[UILabel alloc] initWithFrame:labelPlaceFrame]; labelPlace.font = [UIFont systemFontOfSize:12.0]; labelPlace.textColor = [UIColor darkGrayColor]; [cell.contentView addSubview:labelPlace]; labelCourse.text = course.name; labelPlace.text = course.location; [labelCourse release]; [labelPlace release]; // cell.textLabel.textColor = [UIColor colorWithHexString:@""]; return cell; } </code></pre> <p>Any ideas?</p> <p>Thanks in advance.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload