以下のようなコードを書いたらViewとControllerの参照関係がおかしくなった。
- (void)viewDidLoad { [super viewDidLoad]; if (self.delegate){ self.currerntViewController = [[ChartGridViewController alloc] initWithView:self.chartGridView]; self.switchViewController = [[ChartGridViewController alloc] initWithView:self.chartGridView]; } }
initWithViewで同じViewインスタンスを渡してるから、二つのControllerが同じViewを参照してしまっている。これに気付かずかなり困った。。