Note that there are some explanatory texts on larger screens.

plurals
  1. POUITableView not selecting properly
    primarykey
    data
    text
    <p>I am working on an iPhone app, where I have a UITableView which is being populated with an XML feed through a URL.</p> <p>Say for instance three of the cells are populated.</p> <p>If I tap on the first cell nothing happens, however if I tap on the second or third cell, it takes me to the second screen related to cell one, and the same happens with the other cells - tap on it nothing, tap on another and it takes me to the second screen of the previous one selected.</p> <p>I have never had this happen before and am rather confused.</p> <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"UITableViewCell"]; if (cell == nil) { cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"UITableViewCell"]; } cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; LocationsItem *atm = [[locations atms] objectAtIndex:[indexPath row]]; [[cell textLabel] setText:[atm atmName]]; float distance = [[atm atmDistance] floatValue]; NSString *distanceString = [NSString stringWithFormat:@"%0.2f miles from current location", distance]; [[cell detailTextLabel] setText:distanceString]; return cell; } - (void)tableView:(UITableView *)tableView didDeselectRowAtIndexPath:(NSIndexPath *)indexPath { [tableView deselectRowAtIndexPath:indexPath animated:YES]; LocationsItem *atm = [[locations atms] objectAtIndex:[indexPath row]]; ATMDetailsController *detailsController = [[ATMDetailsController alloc] init]; [detailsController setCurrentATM: atm]; [[self navigationController] pushViewController:detailsController animated:YES]; } </code></pre> <p>Thanks, Nick</p>
    singulars
    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.
 

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