
iOS项目中,启用 ARC特性的情况下,属性( property )的从属限定符必须与实例变量( instance variable )的从性限定符一致,否则将遇到标题中这样的编译错误。最直接的处理方式是去掉实例变量的声明。
亮点:
OR you can just omit the ivar declaration, and just let the compiler do that for you as well. Like this:
@interface Movie : NSObject
@property(assign) NSString *title;
@property(assign) int rating;
@property(assign) int year;
@end
Hope that helps.
谷丽萍
HxLauncher: Launch Android applications by voice commands