———Java培训、Android培训、iOS培训、.Net培训、期待与您交流! ———
**类使用的常见错误汇总**
1.类的声明和实现中不允许包含嵌套
@interface Car : NSObject
//不允许这样嵌套,错误
@interface Dog:NSObject
@end
@end
@implementation Car
@end
2.不能用@implementation 去替换@interface
//@implementation不能替换@interface,会出现警告,不能这样写
@implementation Car : NSObject
{
@public;
int _lunzi;
}
@end
3.漏写end(初学者容易犯的错误)
@interface