条件不起作用

用户名

我用扣子ViewControllerTableViewControllerTableViewController我创建intNInt1。但是,当我去TableViewController条件不起作用。

ViewController.m

- (IBAction)Button:(id)sender {
MasterViewController *trns =[[MasterViewController alloc]init];
[_Button.titleLabel.text isEqualToString:@"1"];
    trns.NInt1=1;
}

TableViewController.m

 - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
if(_NInt1 == 1){
    return 5;
}else{
    return 20;
}
}
杰米什

如果您使用的是故事,请传递如下值:

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    RecipeDetailViewController *destViewController = segue.destinationViewController;
    destViewController.NInt1 = 1;
}

现在,在目标视图控制器的viewDidLoad中查看NInt的值。

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章