在使用code::blocks 写 object-c的时候,
main.m
- #import "one.h"
- int main()
- {
- Car *c=[Car new];
- c->wheels=3;
- c->speed=2;
- [c run];
- return 0;
- }
复制代码
one.h
- #import <Foundation/Foundation.h>
- @interface Car:NSObject
- {
- @public
- int wheels;
- int speed;
- }
- -(void) run;
- @end
复制代码
one.m
- #import "one.h"
- @implementation Car
- -(void)run{
- NSLog(@"个轮子,时速");
- }
- @end
复制代码
当我运行的时候
这个问题怎么解决???
F:\octest\捕获.PNG |
|