Core data 为什么我会出现这个错误;错误:MyTableViewController之前应为说明符限定符列表
1) 我已导入CoreData.framework。在组和文件中,我在FrAMWorkS列表中看到了UIKit.framework、Buffix.Frrices、CyeGrime.Frask.。 2) 我有这个代码,我不知道这个错误是什么意思Core data 为什么我会出现这个错误;错误:MyTableViewController之前应为说明符限定符列表,core-data,ios4,uitableview,Core Data,Ios4,Uitableview,1) 我已导入CoreData.framework。在组和文件中,我在FrAMWorkS列表中看到了UIKit.framework、Buffix.Frrices、CyeGrime.Frask.。 2) 我有这个代码,我不知道这个错误是什么意思 #import <UIKit/UIKit.h> @interface SQLLiteDemoAppDelegate : NSObject <UIApplicationDelegate> { UIWindow *window;
#import <UIKit/UIKit.h>
@interface SQLLiteDemoAppDelegate : NSObject <UIApplicationDelegate> {
UIWindow *window;
MyTableViewController *myTableViewController; //error on this line
}
@property (nonatomic, retain) IBOutlet UIWindow *window;
@end
MyTableViewController.h looks like this
#import <UIKit/UIKit.h>
#import <CoreData/CoreData.h>
@interface MyTableViewController : UITableViewController {
NSMutableArray *names;
}
@end
#导入
@接口SQLLiteDemoAppDelegate:NSObject{
UIWindow*窗口;
MyTableViewController*MyTableViewController;//此行出错
}
@属性(非原子,保留)IBUIWindow*window;
@结束
MyTableViewController.h看起来像这样
#进口
#进口
@接口MyTableViewController:UITableViewController{
NSMutableArray*名称;
}
@结束
MyTableViewController未声明您使用它的位置,因此编译器不知道如何处理该名称。您有两个选项来解决此问题:
//SQLLiteDemoAppDelegate.h
@class MyTableViewController;
@interface SQLLiteDemoAppDelegate : NSObject <UIApplicationDelegate> {
...
//SQLLiteDemoAppDelegate.m
#import "MyTableViewController.h"
...
//SQLLiteDemoAppDelegate.h
@类MyTableViewController;
@接口SQLLiteDemoAppDelegate:NSObject{
...
//SQLLiteDemoAppDelegate.m
#导入“MyTableViewController.h”
...
@class MyTableViewController;
在接口声明之前