• <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>

            厚積薄發(fā),滴水穿石

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

            Objective-C 屬性參數(shù)

            屬性參數(shù)有以下三種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.
                             指定應(yīng)該使用對象的副本(深度復(fù)制),前一個值發(fā)送一條release消息。基本上像retain,但是沒有增加引用計數(shù),是分配一塊新的內(nèi)
                             存來放置它。

            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方法直接賦值,而不進(jìn)行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方法對參數(shù)進(jìn)行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 閱讀(875) 評論(0)  編輯 收藏 引用 所屬分類: IOS

            日韩AV毛片精品久久久| 99久久免费国产特黄| 久久99精品国产麻豆不卡| 久久99精品久久久久久不卡| 麻豆久久| av国内精品久久久久影院| 观看 国产综合久久久久鬼色 欧美 亚洲 一区二区| 久久久国产精品网站| 青青青青久久精品国产h久久精品五福影院1421 | 久久国产精品偷99| 色欲久久久天天天综合网 | 日本久久久久久中文字幕| 亚洲а∨天堂久久精品| 久久久精品一区二区三区| 中文国产成人精品久久亚洲精品AⅤ无码精品 | 久久精品国产免费观看| 精品久久久久久无码人妻热| 久久精品无码专区免费东京热| 99久久亚洲综合精品网站| 无码人妻久久一区二区三区免费| 国产高潮国产高潮久久久91| 久久亚洲精品中文字幕| 久久久久久伊人高潮影院| 日韩久久久久中文字幕人妻 | 亚洲人成无码www久久久| 91精品无码久久久久久五月天| 久久久久亚洲AV无码专区首JN| 久久久久国产精品嫩草影院| 93精91精品国产综合久久香蕉| 99麻豆久久久国产精品免费| 久久久久久久久久久久中文字幕| 亚洲午夜久久久久久久久久| 亚洲国产视频久久| 国产精品久久久久久久app| 性做久久久久久免费观看| 久久综合久久伊人| 欧美久久一区二区三区| 亚洲国产婷婷香蕉久久久久久| 日韩久久久久中文字幕人妻| 中文成人久久久久影院免费观看| 久久只这里是精品66|