StupidBeauty
Read times:784Posted at:Fri Sep 27 20:14:12 2013
- no title specified

转载:Existing ivar 'title' for unsafe_unretained property 'title' must be __unsafe_unretained

iOS项目中,启用 ARC特性的情况下,属性( property )的从属限定符必须与实例变量( instance variable )的从性限定符一致,否则将遇到标题中这样的编译错误。最直接的处理方式是去掉实例变量的声明。

http://stackoverflow.com/questions/8368157/existing-ivar-title-for-unsafe-unretained-property-title-must-be-unsafe-un/8368240#8368240

亮点:

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.

谷丽萍

Your opinions
Your name:Email:Website url:Opinion content:
- no title specified

HxLauncher: Launch Android applications by voice commands

 
Recent comments
2017年4月~2019年4月垃圾短信排行榜Posted at:Thu Sep 26 04:51:48 2024
Qt5.7文档翻译:QWebEngineCookieStore类,QWebEngineCookieStore ClassPosted at:Fri Aug 11 06:50:35 2023盲盒kill -9 18289 Grebe.20230517.211749.552.mp4