今天是个好日子。

我在表视图控制器中有以下代码:

    else if (editingStyle == UITableViewCellEditingStyleInsert) {


        if([[UIScreen mainScreen] bounds].size.height == 568)
        {
            citySearch = [[CitySearch alloc] initWithNibName:@"CitySearchIphone5" bundle:nil];

        }
        else
        {
            citySearch = [[CitySearch alloc] initWithNibName:@"CitySearch" bundle:nil];
        }
        UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:citySearch];
        [self presentModalViewController:navController animated:YES];

因此,当它呈现时,我看到了视图,这超出了界限,Xcode将其编写为

不推荐在分离的视图控制器上显示视图控制器

怎么解决呢?

最佳答案

presentModalViewController:animated:中不推荐使用iOS 6.0。请改用presentViewController:animated:completion:

[self presentViewController:navController animated:YES completion:nil];

Apple Documentation

10-08 12:18