编译错误Property's synthesized getter follows Cocoa naming convention for returning 'owned' objectss

错误在于你的工程下的某一个类中的下面这行

@property (retain, nonatomic) NSString *newImage;

错误就是因为用了new这个关键字,所以说我把new改为news就好了

严格上来说,主要的错误原因是 声明属性时要遵循内存管理原则,即不要使用某些关键字

编译错误Property's synthesized getter follows Cocoa naming convention for returning 'owned' objectss

时间: 2024-09-29 16:41:51

编译错误Property's synthesized getter follows Cocoa naming convention for returning 'owned' objectss的相关文章

错误: Property's synthesized getter follows Cocoa naming convention for returning 'owned'

今天遇到一个奇怪的问题,一开始用下面的代码定义一个全局变量: @property (strong, nonatomic) NSDictionary          *newHomeDataDictionary; 结果一直报错误: Property's synthesized getter follows Cocoa naming convention for returning 'owned',看了好久也找不出问题,后来该前面 new 单词,发现就可以了,这才发现是苹果禁止了所有已 new 关

error: property's synthesized getter follows Cocoa naming convention for returning 'owned' objects I

error: property's synthesized getter follows Cocoa naming convention for returning 'owned' objects In file included from /Users/developer/Documents/StarShow/ShowWall/View/NewShowItemView.m:9: /Users/developer/Documents/StarShow/ShowWall/View/NewShowI

error: property's synthesized getter follows Cocoa naming convention for returning 'owned' objects

出现这种情况,主要是属性名中包含  关键字. You can solve this by: Renaming that property: @property (strong, nonatomic) NSString *theNewTitle; Keeping the property name and specifying a getter name that doesn't begin with one of the special method name prefixes: @proper

Error解决:Property's synthesized getter follows Cocoa naming convention for returning 'owned'

在项目中定义了以new开头的textField,结果报错: 先看我的源码: #import <UIKit/UIKit.h> @interface ResetPasswordViewController : UIViewController @property (weak, nonatomic) IBOutlet UITextField *phoneTextField; @property (weak, nonatomic) IBOutlet UITextField *oldPasswordTe

小胖说事24-----property&#39;s synthesized getter follows Cocoa naming convention for returning &#39;owned&#39; objec

今天在给类的属性命名的时候,用了newValue,就给报错:property's synthesized getter follows Cocoa naming convention for returning 'owned' objects,一阵郁闷不知道咋回事,后来查了资料后,原来是命名规范的事情: You own any object you create You create an object using a method whose name begins with "alloc&q

iOS编译错误:Property cannot have array or function type &#39;Block&#39; (aka &#39;void (XXXXView *__st

XXXXView 中的Block错误,原因: typedef void (^Block)(XXXXView *); 在这个demo中忘记写^了,导致此错误 iOS编译错误:Property cannot have array or function type 'Block' (aka 'void (XXXXView *__st

visual studio编译错误集(转)

1.error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 在项目属性->Configration Properties->C/C++->Command Line页面的Additional Options中加入/wd4430 2.error MSB3073: The command regsvr32 /s /c 解决办法 最近将VC2002 代码移植到VC2010,

VC中常见编译错误[转]

VC中常见编译错误(转载看看) 1)disable#pragma warning (disable: 4311 4312)     //指针类型强制转化,大小不完全匹配warning C4311: ''type cast'' : pointer truncation from ''TriNode *const '' to ''long''     warning C4312: ''type cast'' : conversion from ''unsigned int'' to ''SAC_No

Xcode工程编译错误:“Cannot assign to &#39;self&#39; outside of a method in the init family”

#import <Foundation/Foundation.h> @interface EOCRectangle : NSObject<NSCoding> @property (nonatomic , readonly , assign) float width; @property (nonatomic , readonly , assign) float height; -(id)initWithWidth:(float) width andHeight:(float) he