objective-c - Xcode 错误 : Expected identifier

标签 objective-c ios xcode uitableview uitabbarcontroller

<分区>

我在这行代码中收到一条错误消息,指出“Expected Identifier”

UINavigationController *navController1 = [[[UINavigationController alloc] initWithRootViewController:viewController4]];  

这段代码放在application Delegate中如下

#import "AppDelegate.h"

#import "FirstViewController.h"

#import "SecondViewController.h"

#import "ParkTable.h"
#import "TableTest.h"

@implementation AppDelegate

@synthesize window = _window;
@synthesize tabBarController = _tabBarController;
@synthesize ParkTableDel = _tableViewController;
@synthesize navController;




- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
UIViewController *viewController1 = [[FirstViewController alloc] initWithNibName:@"FirstViewController" bundle:nil];
UIViewController *viewController2 = [[SecondViewController alloc] initWithNibName:@"SecondViewController" bundle:nil];
UITableViewController *viewController3 = [[ParkTable alloc] initWithNibName:@"ParkTable" bundle:nil];
UITableViewController *viewController4 = [[TableTest alloc] initWithNibName:@"TableTest" bundle:nil];
UINavigationController *navController1 = [[[UINavigationController alloc] initWithRootViewController:viewController4]];  

self.tabBarController = [[UITabBarController alloc] init];
self.ParkTableDel = [[UITableViewController alloc] init];

self.tabBarController.viewControllers = [NSArray arrayWithObjects:viewController1, viewController2, viewController3, viewController4, nil];
self.window.rootViewController = self.tabBarController;    
[self.window makeKeyAndVisible];
return YES;
}

// [...] Boilerplate code removed.
@end

我想知道我必须更改什么才能使其正确。

最佳答案

会不会是多了一组括号? [ ]

关于objective-c - Xcode 错误 : Expected identifier,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8024638/

相关文章:

xcode - 我是否需要链接依赖项链接的库?

iphone - 使用一对多关系按依赖属性对 NSFetchRequest 进行排序

ios - 表格 View 单元格高度

objective-c - 用于多对多对多关系的 NSPredicate 过滤器

ios - Swift 编译器问题 : Compiler doesn't compile long parameters array for Alamofire post request

ios - 快速单击按钮时更改 tableView 文本标签

ios - 当我为 AFNetworking 设置我的 downloadProgressBlock 时,它只会在最后调用一次

ios - 当实际中心看起来偏离时,在视觉上将 UILabel 居中到它的 super View

ios - UIGraphicsBeginImageContext 不返回视网膜图像

ios - 我的 iPhone 应用程序应该占用多少内存?