Jas*_*son 2 iphone import objective-c cs193p
这是我的头文件
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#import <PolygonShape.h>
@interface Controller : NSObject {
IBOutlet UIButton *decreaseButton;
IBOutlet UIButton *increaseButton;
IBOutlet UILabel *numberOfSidesLabel;
//IBOutlet PolygonShape *shape;
}
- (IBAction)decrease;
- (IBAction)increase;
@end
Run Code Online (Sandbox Code Playgroud)
这是我的实现文件
#import "Controller.h"
@implementation Controller
- (IBAction)decrease {
//shape.numberOfSides -= 1;
}
- (IBAction)increase {
//shape.numberOfSides += 1;
}
@end
Run Code Online (Sandbox Code Playgroud)
为什么我的#import "Controller.h"
线路上出现以下错误?
error: PolygonShape.h: No such file or directory
Run Code Online (Sandbox Code Playgroud)
PolygonShape.h和.m文件与Controller类位于同一项目中,并位于同一目录中.
angle braces(<>
)表示文件位于标准包含路径中,例如/ usr/include或/ System/Library/Frameworks.要导入相对于当前目录的文件,您需要像使用双引号一样使用双引号#import "Controller.h"
.
归档时间: |
|
查看次数: |
2194 次 |
最近记录: |