大佬教程收集整理的这篇文章主要介绍了objective-c – 在ObjC代码上使用LLVM 3.0抑制属性定义警告,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
> -Xclang
> -fobjc-default-synthesize-properties
现在你可以摆脱你的@synthesize样板代码,如果你只想要属性合成的默认设置(我想我们已经使用了自动引用计数).
当我点击构建时,编译器警告我缺少@synthesize等语句,如下所示:
@H_596_28@myController.h:34:43: warning: property 'myProperty' requires method 'myProperty' to be defined - use @synthesize,@dynamic or provide a method implementation [3] @property (strong,nonatomiC) MyClass *myProperty;
我更喜欢无警告的构建,所以问题是:我怎样才能抑制这种警告,因为显然它们已经没有意义了.
clang -x objective-c -Xclang -fobjc-default-synthesize-properties -c TESTClass.m -o TESTClass.o
没有显示任何警告
clang -x objective-c -fobjc-default-synthesize-properties -c TESTClass.m -o TESTClass.o
这是正确的方式,因为没有合成属性
#import <Foundation/Foundation.h> @interface TESTClass : NSObject @property (nonatomic,strong) NSObject * test; @end @implementation TESTClass @end
以上是大佬教程为你收集整理的objective-c – 在ObjC代码上使用LLVM 3.0抑制属性定义警告全部内容,希望文章能够帮你解决objective-c – 在ObjC代码上使用LLVM 3.0抑制属性定义警告所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。