0
我目前正在研究一個應用程序,其中有兩個主要的故事板; ViewController和MainViewController。獲取編譯器錯誤預期標識符/期望的方法體
我想在我的MainViewController.m中出現Expected Identifier
和Expected method body
錯誤。
這裏是文件:
//
// MainView.m
// Ski Finder Intro
//
// Created by Hunter Bryant on 10/20/12.
// Copyright (c) 2012 Hunter Bryant. All rights reserved.
//
#import "MainViewController.h"
@interface MainViewController()
@end
@implementation MainViewController
- (id)initWithNibName:@"MainViewController" bundle:Nil //Here are both of the errors.
{
self = [super initWithNibName:@"MainViewController'" bundle:Nil];
if (self) {
// Custom initialization
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
與您的旁註相反,初始化器應始終在一個類中鏈接。 –
是的,當然,然而我對這種模式感到沮喪。我更喜歡'-commonInit'(這相當於同樣的事情,但... – CodaFi