したがって、ナビゲーションコントローラーをタブバーコントローラーに埋め込むアプリケーションがあります。私はデータを取得するNSMutableArrayを持っています。配列のインデックスが表示されないナビゲーションバーのコントローラーのコントローラ
問題は、テーブルビューが表示され、1つをクリックすると詳細ビューが表示されますが、実際にはうんざりしたパターンになります。セル2を初めてクリックすると、セル2の詳細ビューが表示されます。 「Back」をクリックして「Cell 2」をもう一度クリックすると、詳細ビューは表示されず、「Cell 3」をクリックすると「Cell 2 Detail View」が表示され、「Back」をクリックするたびに注文が変更されます。私は何が間違っていますか?
#pragma mark - View lifecycle methods
- (void)viewDidLoad
{
[super viewDidLoad];
searchResultsArray = [[NSMutableArray alloc] initWithObjects:@"Producer 1", @"Producer 2",@"Producer 3", nil];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil)
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
reuseIdentifier:CellIdentifier] autorelease];
cell.textLabel.text = [searchResultsArray objectAtIndex:indexPath.row];
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
return cell;
}
- (void)tableView:(UITableView *)tableView didDeselectRowAtIndexPath:(NSIndexPath *)indexPath
{
NearMeDetailViewController *nmdvController = [[NearMeDetailViewController alloc] initWithNibName:@"NearMeDetailViewController" bundle:nil];
NSLog(@"%i", indexPath.row);
nmdvController.producerName = [searchResultsArray objectAtIndex:indexPath.row];
NSLog(@"%@", [searchResultsArray objectAtIndex:indexPath.row]);
[self.navigationController pushViewController:nmdvController animated:YES];
[nmdvController release];
}
私は結果 –
よ、これはそれを知らせてください。私が間違っているのは、私たちが間違っていることがわかっているのです。 – yretuta