さて、ビューに がありNSMutableArray
、この配列の値を別のビューに渡したいと思います。[self presentModel view controller ...]
しかし、作成した別のボタンを押したときに別のビューを表示したいだけなので、このメソッドを使用したくありません。問題は、ボタンを押して配列の値を表示すると、配列の値が失われ、空が[self presentModel view controller ...]
返されることですが、メソッドを使用すると、値が正しく返されます。
現在のビュー:
@property and @synthesise AnotherViewController *superAnother
AnotherViewController *anView = [[AnotherViewController alloc]initWithNibName:nil bundle:nil];
superAnother.arrayOfTheAnotherView = [[NSMutableArray alloc]initWithArray:arrayOfTheCurrentView];
別のビュー:
@property and @synthesise NMutableArray *arrayOfTheAnotherView;
NSMultableArray array = [[NSMultableArray alloc]initWithArray:arrayOfTheAnotherView];
配列を使用してテーブル ビューをロードする:
cell.textLabel.text = [array objectAtIndex:indexPath.row];