• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            厚積薄發,滴水穿石

            搬家到主站了:http://www.cnblogs.com/cokecoffe/
            隨筆 - 45, 文章 - 8, 評論 - 12, 引用 - 0
            數據加載中……

            Objective-C 屬性參數

            屬性參數有以下三種Writability、Setter、Semantics Atomicity

            Writability


            These attributes specify whether or not a property has an associated set accessor. They are mutually exclusive.

            readwrite Indicates that the property should be treated as read/write. This attribute is the default.
            readonly  If you use the @synthesize directive in the implementation block, only the getter method is synthesized. Moreover, if you attempt to assign a value using the dot syntax, you get a compiler error.

            Setter Semantics


            These attributes specify the semantics of a set accessor. They are mutually exclusive.
            strong
            weak
            copy    Specifies that a copy of the object should be used for assignment.The previous value is sent a release message.The copy is made by invoking the copy
             
                           method. This attribute is valid only for object types, which must implement the NSCopying  protocol.
                             指定應該使用對象的副本(深度復制),前一個值發送一條release消息?;旧舷駌etain,但是沒有增加引用計數,是分配一塊新的內
                             存來放置它。

            assgin Specifies that the setter uses simple assignment. This attribute is the default. You use this attribute for scalar types such as NSInteger and CGRect.
                        setter方法直接賦值,而不進行retain操作,比如NSInteger和CGRect,它們不是對象,所以不用release。

            retain Specifies that retain should be invoked on the object upon assignment.The previous value is sent a release message.
                        setter方法對參數進行release舊值,再retain新值 例如:    
                  1.-(void) setObj:(ClassX*) value
                     2.{
                   3.         if (obj != value)
                   4.         {
                   5.                   [obj release];
                   6.                   obj = [value retain];
                   7.         }
                   8.}

            Atomicity


            You can use this attribute to specify that accessor methods are not atomic. (There is no keyword to denote atomic.)
            nonatomic Specifies that accessors are nonatomic. By default, accessors are atomic.

             

            posted on 2012-02-04 23:09 Wangkeke 閱讀(886) 評論(0)  編輯 收藏 引用 所屬分類: IOS

            亚洲日本va午夜中文字幕久久| 久久99精品久久久久久| 亚洲精品WWW久久久久久| 久久久久久久波多野结衣高潮| 午夜欧美精品久久久久久久| 看久久久久久a级毛片| 国产精品丝袜久久久久久不卡| 一级a性色生活片久久无少妇一级婬片免费放| 久久久久久久波多野结衣高潮| 99热成人精品免费久久| 18岁日韩内射颜射午夜久久成人 | 国产精品熟女福利久久AV| 无码国内精品久久人妻麻豆按摩| 久久免费的精品国产V∧| 久久精品亚洲乱码伦伦中文| 97久久超碰国产精品旧版 | 97精品伊人久久久大香线蕉| 丁香久久婷婷国产午夜视频| 久久妇女高潮几次MBA| 久久久久久国产a免费观看不卡| 日产精品99久久久久久| 狠狠色丁香久久婷婷综合| 欧美性大战久久久久久| 国产综合精品久久亚洲| 国产成人久久激情91| 蜜臀久久99精品久久久久久小说| 欧美精品丝袜久久久中文字幕| 亚洲国产精品人久久| 国产精品视频久久| 国内精品伊人久久久久| 国产精品禁18久久久夂久| 狠狠色丁香婷婷综合久久来| 97超级碰碰碰久久久久| 77777亚洲午夜久久多喷| 久久99精品久久久久久久不卡 | 久久久久亚洲AV成人片| 久久久久人妻一区二区三区| 亚洲AV日韩AV天堂久久| 久久久久久久人妻无码中文字幕爆| 亚洲AV无码成人网站久久精品大| 亚洲乱码中文字幕久久孕妇黑人|