今天在写ios 页面相互跳转(包括值传递)
界面1(ViewController.h)
#import <UIKit/UIKit.h>
#import "ViewController1.h"
#import "RecevieMessageFrom2.h"
@interface ViewController : UIViewController<RecevieMessageFrom2>
@property (nonatomic,copy)NSString* value;
@end
界面1(ViewController1)
#import <UIKit/UIKit.h>
#import "RecevieMessageFrom2.h"
#import "ViewController.h"
@interface ViewController1 : UIViewController
@property(nonatomic,copy)NSString* content;
@property(nonatomic,strong)ViewController* first;
@end
“`
运行的时候就出现unknown type name”ViewController”,did you mean”ViewController1”
error表示没有引入。ViewController1.h文件中引入@class ViewController;程序就可以运行了。