一直试图在一行代码中查找错误。返回已被注释掉的预期标识符错误。
您能帮我找到错误吗?谢谢。
对不起,错误的代码格式;不知道如何在这里解决。
#import "BIDAppDelegate.h"
#import "BIDSwitchViewController.h"
@implementation BIDAppDelegate
@synthesize window = _window;
@synthesize switchViewController;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
self.switchViewController = [[BIDSwitchViewController alloc]
initWithNibName:@"Switch View"
bundle:nil];
UIView *switchView = self.switchViewController.view;
CGRect switchViewFrame = switchView.frame;
switchViewFrame.origin.y += [[UIApplication sharedApplication].statusBarFrame.size.height; // Expected identifier
switchView.frame = switchViewFrame;
[self.window addSubview:switchView];
self.window.backgroundColor = [UIColor whiteColor];
[self.window makeKeyAndVisible];
return YES;
}
最佳答案
您在冒犯性陈述的开头有一个额外的[。 :[[UIApplication sharedApplication]
应该是[UIApplication sharedApplication]
要格式化代码,请将其粘贴,选择它,然后按问题编辑器顶部的{}按钮。
关于ios - 预期标识符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8330690/