いくつかの初期構成を行うためにいくつかのモーダル ビューが読み込まれている分割ビューがあります。その構成手順の最後のステップの後、ユーザーはオプションを選択する必要があり、そのオプションに応じて rootviewcontroller はデータをリロードする必要があります。
私は次のコードを持っています:
これは、構成の最後のビューのボタンからのものです
RootListViewController *rootMenu = [[RootListViewController alloc]init];
rootMenu.matNum = matnum;
[rootMenu.tableView reloadData];
[self performSegueWithIdentifier:@"PushToMainStaff" sender:self];
これはRootListViewです
@implementation RootListViewController
@synthesize matNum;
- (void)viewDidLoad
{
[super viewDidLoad];
NSLog(@"viewdidload root");
if(matNum > 0){
// just a test
brackets = [NSArray arrayWithObjects:@"Category 1", @"Category 2", @"Category 3", nil];
[self.tableView reloadData];
}
}
そして、これはそのルートビューの詳細を表示するセルです
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"CategoryCell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
// Configure the cell...
cell.textLabel.text = [brackets objectAtIndex:indexPath.row];
return cell;
}
私がステップスルーするとき、それは通過しません
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
method.reloadData をトリガーしてから viewDidLoad をトリガーするだけですが、それだけです。パスを正しく行っているのか、フロー全体を処理する方法が間違っているのかわかりませんか?
何かご意見は?必要に応じて、ストーリーボードも投稿できます。
ありがとう!!