首页 新闻 会员 周边

ios切换界面的神奇问题

0
悬赏园豆:60 [已关闭问题] 关闭于 2014-06-14 14:34

有一个tableview分别打开对应界面进行数据查询。我这边为了演示问题,将第一个和第二个选项指向同一个界面,代码如下

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
     UIStoryboard *story=[UIStoryboard storyboardWithName:@"kj128storyboard" bundle:nil];
    if(indexPath.section==1)
    {
        if(indexPath.row==0)
        {
            kj128HisStateQueryController   *kj128hisstation=[story instantiateViewControllerWithIdentifier:@"kj128hisbadstationquery"];
            [self.navigationController pushViewController:kj128hisstation animated:YES];
        }
        if(indexPath.row==1)//历史进出分站
        {
            kj128HisStateQueryController   *kj128hisstation=[story instantiateViewControllerWithIdentifier:@"kj128hisbadstationquery"];
            [self.navigationController pushViewController:kj128hisstation animated:YES];
        }
        else//历史进出分站
        {
            kj128HisStationQueryController   *kj128hisstation=[story instantiateViewControllerWithIdentifier:@"kj128hisstationquery"];
            [kj128hisstation initWithIndex:indexPath.row];
            [self.navigationController pushViewController:kj128hisstation animated:YES];
        }
    }
}

很简单的实现了,但是运行过程中出现问题了,点击第一个选项打开的界面有问题,并且无法返回。第二个界面就是正常的,上图最后一个图是第二个选项对应的界面显示正常。

 

面对如此奇葩的问题只能求助博友了,谢谢

ios
钱耀祖的主页 钱耀祖 | 初学一级 | 园豆:44
提问于:2014-06-14 14:11
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册