AlexWienの答えを少し詳しく説明するには...
- 完了後にユーザーが移動するビュー コントローラーまたはテーブル ビュー コントローラー クラスを作成します。
- 渡すデータのプロパティをいくつか作成します。
@protocol UpdatePricesDelegate;
@interface NXUpdatePricesViewController : UITableViewController
@property (strong, nonatomic) NSArray *calculationProducts;
@property (strong, nonatomic) NSArray *filteredCalculationProducts;
@property (weak, nonatomic) id<UpdatePricesDelegate>delegate;
@end
@protocol UpdatePricesDelegate <NSObject>
- (void)updatePricesController:(NXUpdatePricesViewController *)controller didUpdateCalculationProducts:(NSArray *)calculationProducts;
@end
- コントローラーを表示する準備ができたら (おそらく If/Else ステートメントで)、クラスをインスタンス化し (#import "MyClassName.h" を忘れないでください)、渡したい変数にプロパティを設定します。
- クラスをモーダルに表示します (例にはナビゲーション コントローラーが含まれます)。ビューをプッシュする場合は、ナビゲーション コントローラーを使用します。
NXUpdatePricesViewController *updatePricesController = [[NXUpdatePricesViewController alloc] initWithStyle:UITableViewStyleGrouped];
updatePricesController.delegate = self;
updatePricesController.calculationProducts = self.calculationProducts;
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:updatePricesController];
navigationController.modalPresentationStyle = UIModalPresentationFormSheet;
[self.navigationController presentViewController:navigationController animated:YES completion:nil];
NXCalculationViewController *calculationController = [[NXCalculationViewController alloc] init];
calculationController.calculation = calculation;
[self.navigationController pushViewController:calculationController animated:YES];