如果这个property是 BOOL on, 
那么Objc默认创建的 setter 为: 

- (void)on:(BOOL)setOn 




getter 为: 
- (BOOL)on 

return on; 


但是你可以手动更改 setter 和 getter 方法,就像上面的: 

getter = xxxOn 的话, 

getter 就变为: 

- (BOOL)xxxOn 

return on; 
}

@property (nonatomic, getter = isExpanded) BOOL expanded;的更多相关文章

  1. IOS解惑(1)之@property(nonatomic,getter=isOn) BOOL on;中的getter解惑

    1 问题: @property(nonatomic,getter=isOn) BOOL on; 中的getter = isOn的含义? 2 答案: 如果这个property是 BOOL on, 那么O ...

  2. 写一个 setter 方法用于完成 @property (nonatomic, retain) NSString *name,

    写一个 setter 方法用于完成 @property (nonatomic, retain) NSString *name 写一个 setter 方法用于完成 @property (nonatomi ...

  3. 使用property取代getter和setter方法

    class Days(object): def __init__(self): self.__days = 0 @property def days(self):#获取函数,名字是days days ...

  4. @property(nonatomic) UIViewAutoresizing autoresizingMask;

    在 UIView 中有一个autoresizingMask的属性,它对应的是一个枚举的值(如下),属性的意思就是自动调整子控件与父控件中间的位置,宽高. 1 2 3 4 5 6 7 8 9 enum  ...

  5. Objective-C中的@Property详解

    Objective-C中的@Property详解 @Property (属性) class vairs 这个属性有nonatomic, strong, weak, retain, copy等等 我把它 ...

  6. @property中有哪些属性关键字?/ @property 后面可以有哪些修饰符?

    出题者简介: 孙源(sunnyxx),目前就职于百度 整理者简介:陈奕龙(子循),目前就职于滴滴出行. 转载者:豆电雨(starain)微信:doudianyu 属性可以拥有的特质分为四类: 原子性- ...

  7. @property的特性

    @property还有一些关键字,它们都是有特殊作用的,比如上述代码中的nonatomic,strong: 1 2 @property(nonatomic,strong) NSString *carN ...

  8. Objective-C中的@Property具体解释

    Objective-C中的@Property具体解释 @Property (属性) class vairs 这个属性有nonatomic. strong. weak, retain. copy等等 我 ...

  9. @property 修饰符

    原子性--- nonatomic 特质 在默认情况下,由编译器合成的方法会通过锁定机制确保其原子性(atomicity).如果属性具备 nonatomic 特质,则不使用同步锁.请注意,尽管没有名为“ ...

随机推荐

  1. DataOutputStream的writeBytes(String s)

    最近,在关于网络请求中有用到DataOutputStraem中的writeBytes()方法,然而就是这个问题,导致了传输中文时就出现问题,着实困扰了很长一段时间. 后来,服务器端同事建议我使用Dat ...

  2. Android仿人人客户端(v5.7.1)——新鲜事之完整篇

    转载请标明出处: http://blog.csdn.net/android_ls/article/details/9228083       声明:仿人人项目,所用所有图片资源都来源于其它Androi ...

  3. Android 布局详解

    Android 布局详解 1.重用布局 当一个布局文件被多处使用时,最好<include>标签来重用布局. 例如:workspace_screen.xml的布局文件,在另一个布局文件中被重 ...

  4. C语言之进制

    进制 一种计数的方式.侧重点在于计数的时候是逢多少进一. 1)      C语言可以识别的进制 二进制 每一位. 0 0 1 0 0 1 1 0 1 0 1 0 0 1 0 1 1 0 在C语言中,写 ...

  5. 你真的懂javascript中的 “this” 吗?

    一.前言: 我们知道 "this" 是javascript语言的一个关键字,在编写javascript代码的时候,经常会见到或者用到它. 但是,有一部分开发朋友,对 "t ...

  6. java基础IO删除文件夹文件

    /** * 定义一个方法,能够删除任意文件夹,文件夹路径由键盘录入 注意:不要在C盘下做测试,请选定无用的文件夹测试! */ 1.键盘录入 private static File getfile() ...

  7. [Angular Directive] Implement Structural Directive Data Binding with Context in Angular

    Just like in *ngFor, you're able to pass in data into your own structural directives. This is done b ...

  8. springmvc中返回页面,只在iframe中跳转,而不是整个页面,解决方法。

    问题描述:在我写的主页面中用到了iframe,其中在iframe中有一个button点击提交,然后在Controller中返回页面的时候,是在iframe中打开的,而不是整个页面. 最开始我想用aja ...

  9. 自己找到的一些比较实用比较好看的前端特效。很多是前面提供的jquery网站的

    http://www.cnblogs.com/zhangzongle/p/6034394.html webservicehttp://blog.csdn.net/wowkk/article/detai ...

  10. mysql版本,根据经纬度定位排序sql

    SELECT id,lng,lat,ROUND(6378.138*2*ASIN(SQRT(POW(SIN((lat1*PI()/180-lat*PI()/180)/2),2)+COS(lat1*PI( ...