0

所以我刚刚创建了一个新项目,它在我接触文件之前就显示了错误,我对 Xcode 很陌生,但这是我的代码:

#import "ViewController.h"

@interface "ViewController.h"

@end

@implementation ViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
        return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
    } else {
        return YES;
    }
}

@end

并且在“@interface”ViewController.h“”处显示了标题中的错误

4

2 回答 2

8

这就是错误。你想要@interface ViewController

于 2012-06-24T18:44:02.320 回答
0

这是

@interface ViewController


@end 

" "导入标头、<>框架时必须使用。

@interface是一个objective-c对象,在这种情况下是一个类,所以你不需要"".

于 2012-06-24T19:43:45.733 回答