出现这样的情况,主要是属性名中包括  keyword.

You can solve this by:

  1. Renaming that property:

    @property (strong, nonatomic) NSString *theNewTitle;
  2. Keeping the property name and specifying a getter name that doesn’t begin with one of the special method name prefixes:

    @property (strong, nonatomic, getter=theNewTitle) NSString *newTitle;
  3. Keeping both the property name and the getter name, and telling the compiler that, even though the getter name starts with new,
    it belongs to the none method
    family as opposed to the newmethod
    family:

    #ifndef __has_attribute
    #define __has_attribute(x) 0 // Compatibility with non-clang compilers
    #endif #if __has_attribute(objc_method_family)
    #define BV_OBJC_METHOD_FAMILY_NONE __attribute__((objc_method_family(none)))
    #else
    #define BV_OBJC_METHOD_FAMILY_NONE
    #endif @interface ViewController : UIViewController
    @property (strong, nonatomic) NSString *newTitle;
    - (NSString *)newTitle BV_OBJC_METHOD_FAMILY_NONE;
    @end

    Note that even though this solution allows you to keep newTitle as
    both the property name and the getter name, having a method called -newTitle that
    doesn’t return an object owned by the caller can be confusing for other people reading your code.

error: property's synthesized getter follows Cocoa naming convention for returning 'owned' objects的更多相关文章

  1. 小胖说事24-----property's synthesized getter follows Cocoa naming convention for returning 'owned' objec

    今天在给类的属性命名的时候,用了newValue.就给报错:property's synthesized getter follows Cocoa naming convention for retu ...

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

    在项目中定义了以new开头的textField.结果报错: 先看我的源代码: #import <UIKit/UIKit.h> @interface ResetPasswordViewCon ...

  3. Property's synthesized getter follows Cocoa naming convention for returning

    Property's synthesized getter follows Cocoa naming convention for returning.   今天早上在整理代码的时候发现了如上警告. ...

  4. JSON: Property 'xxx' has no getter method的解决办法

    在使用JSONArray.fromObject时候出现JSONException:Property 'xxx' has no getter method. 解决办法:设置bean为public属性即可 ...

  5. JSON: property "xxx" has no getter method in class "..."

    Exception in thread "main" net.sf.json.JSONException: java.lang.NoSuchMethodException: Pro ...

  6. 【python】面向对象编程之@property、@setter、@getter、@deleter用法

    @property装饰器作用:把一个方法变成属性调用 使用@property可以实现将类方法转换为只读属性,同时可以自定义setter.getter.deleter方法 @property&@ ...

  7. ios 常见问题解决

    一,libxml/HTMLparser.h file not find 第一种方法: 点击左边项目的根目录,再点击右边的Build Settings,手工输入文字:“Header search pat ...

  8. ARC

    ARC是什么 ARC是iOS 5推出的新功能,全称叫 ARC(Automatic Reference Counting).简单地说,就是代码中自动加入了retain/release,原先需要手动添加的 ...

  9. IOS- 02 零碎知识总结

    1.UIView,UIViewController,UIWindow和CALayer UIView是什么,做什么:UIView是用来显示内容的,可以处理用户事件 CALayer是什么,做什么:CALa ...

随机推荐

  1. Android学习笔记(一)开发环境搭建

    Android开发环境搭建 安装JDK 1.如果你还没有JDK的话,可以去这里http://www.oracle.com/technetwork/java/index.html ,接下来的工作就是安装 ...

  2. php中0,空,null和false的区别

    <? $str1 = null; $str2 = false; echo $str1==$str2 ? ‘相等’ : ‘不相等’; $str3 = ""; $str4 = 0 ...

  3. js表格排序 & 去除字符串空格

    // a:列数 bool:排序升序判断参数 true false Str:支持多列 function newUnitSort(a, bool, str) { var oTable = document ...

  4. tomcat远程debug端口开启

    declare -x CATALINA_OPTS="-server -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt ...

  5. [转]JSon数据解析的四种方式

    转至http://blog.csdn.net/enuola/article/details/7903632 作为一种轻量级的数据交换格式,json正在逐步取代xml,成为网络数据的通用格式. 有的js ...

  6. 【转】context和getApplicationContext()介绍

    在android中常常会遇到与context有关的内容,大多都是作为参数在传递,但是它的作用究竟是什么呢 先说它的用法,举个例子 在语句 AlertDialog.Builder builder = n ...

  7. angulajs 当input使用 bootstrap的email类型时,如果是无效的email格式,则ng-model无效的情况

    当使用bootstrap的如下input时 <input type="email" ng-model="userid"> 如果输入的内容是无效的em ...

  8. 取代奶瓶Minidwep-gtk 破 WPA 全攻略

     目录 1. CDlinux 下使用 minidwepgtk 获取握手包并使用自带的字典破解 2. 自带的字典破解不出密码时使用 U 盘外挂字典继续暴力破解密码 3. 将握手包拷贝到 Windows ...

  9. robomongo

    Robomongo 是一个可视化的mongodb数据库工具,提供对mongodb的操作,javascript执行及语法高亮提示. 安装教程

  10. 关于Unix时间戳

    如何在不同编程语言中获取现在的Unix时间戳(Unix timestamp)? Java time JavaScript Math.round(new Date().getTime()/1000)ge ...