OBJ C - 错误:在'interface'之前没有指定类型或存储类

时间:2011-05-08 00:11:36

标签: objective-c

我有新的.h .m .xib文件,并且在我获得的接口声明旁边的编译中: 可能在另一个文件中出现问@end到位了。当UIKit是唯一的导入时,结果相同。

错误:在'interface'

之前,不能在此处指定类型或存储类
   #import <UIKit/UIKit.h>
   #import "NavigationDelegate.h"
   #import "ErrorDelegate.h"


@interface PortraitFrontViewController : UIViewController {

}
@end

编辑: PortraitFrontViewController.h:

#import "PortraitFrontViewController.h"


@implementation PortraitFrontViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)dealloc
{
    [super dealloc];
}

- (void)didReceiveMemoryWarning
{
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];

    // Release any cached data, images, etc that aren't in use.
}

#pragma mark - View lifecycle

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

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    return YES;
}

@end

1 个答案:

答案 0 :(得分:1)

编辑:没关系,OP在发布代码时犯了一个错误。将在发布其他文件时更新此答案。