私は 1 つの小さな iOS アプリを開発しており、View Controller のナビゲーションで問題に直面しています。これは私のコードです(ネットから入手しました):
- (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath: (NSIndexPath *)indexPath
{
DetailsViewController *page = [[DetailsViewController alloc] init];
CGRect theFrame = page.view.frame;
theFrame.origin = CGPointMake(self.view.frame.size.width, 0);
page.view.frame = theFrame;
theFrame.origin = CGPointMake(0,0);
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.2f];
page.view.frame = theFrame;
[UIView commitAnimations];
[self.view addSubview:page.view];
}
これにより、新しいView Controllerに移動できます。これは正常に機能していますが、ボタンをタップすると元のコントローラーに戻る必要があります。これは私が立ち往生しているところであり、ナビゲーションコントローラーを使用しておらず、iOS は初めてです。より良い方法でこれを行う方法についてアイデアをお持ちの方がいらっしゃいましたら、ぜひお聞かせください。