出现这样的情况,主要是属性名中包括  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. 两个textarea 同时变化高度

    <html><head><script type="text/javascript" src="/jquery/jquery.js" ...

  2. 【转】adb.exe,start-server' failed -- run manually if necessary

    [转]Android adb.exe程序启动不起来,如何处理 解决问题: 百度google大家多说的是任务管理器 kill掉adb 或者重启adb server,但我任务管理器就没有adb ,猜测是某 ...

  3. hdu 1251 统计难题(trie 树的简单应用)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1251 题意:给你多个字符串,求以某个字符串为前缀的字符串数量. 思路:简单的trie数应用,在trie ...

  4. JQuery中判断checkbox是否选中与禁用鼠标右键

    if ($("#wds_checkbox").attr("checked")) { flag = ; } else { flag = ; } 禁用鼠标右键 // ...

  5. mysql修改用户名和密码

    修改用户名 mysql> use mysql;  选择数据库Database changedmysql> update user set user="dns" wher ...

  6. datatable,查询,排序,复制等操作

    DataTable排序,检索,合并详解 一.排序 获取DataTable的默认视图 对视图设置排序表达式 用排序后的视图导出的新DataTable替换就DataTable (Asc升序可省略,多列排序 ...

  7. selenium 学习笔记 ---新手学习记录(1) 问题总结

    说明:每次学习各种语言时,环境搭建访问国外网址最头疼了,现在只要是工具下载好放到自己网盘,可以随时用. 1.首先工具准备,selenium需要用到的 下载地址 访问密码 ff8f 2.我选择的语言时j ...

  8. 设置MAVEN_OPTS的推荐方法

    运行mvn eclipse:eclipse时,经常会出现因为maven项目过大,导致内存不足java栈溢出的error,需要更改MAVEN启动内存 http://stackoverflow.com/q ...

  9. MVC-07 案例1

    >>>>>ContosoUniversity网站 ------------------------------------------- 一.并发冲突 1. 为什么会并发 ...

  10. html常用标签有哪些

    html看似复杂,其实常用的标签并不多,这里总共介绍一些html的常用标签 文字处理: ①标题:<h1> to <h6> ②段落:<p>文字段落</p> ...