• <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, 評(píng)論 - 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)該使用對(duì)象的副本(深度復(fù)制),前一個(gè)值發(fā)送一條release消息。基本上像retain,但是沒有增加引用計(jì)數(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,它們不是對(duì)象,所以不用release。

            retain Specifies that retain should be invoked on the object upon assignment.The previous value is sent a release message.
                        setter方法對(duì)參數(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 閱讀(879) 評(píng)論(0)  編輯 收藏 引用 所屬分類: IOS

            99re久久精品国产首页2020| 久久天天躁狠狠躁夜夜av浪潮| 亚洲中文字幕久久精品无码APP | 国产午夜福利精品久久| 国内精品久久久久久不卡影院| 午夜精品久久久久| 国产精品一区二区久久不卡 | 久久亚洲中文字幕精品有坂深雪| 亚洲国产二区三区久久| 欧美一区二区久久精品| 91精品国产色综久久| 激情伊人五月天久久综合| 久久久国产亚洲精品| 久久se精品一区二区影院| 精品国产乱码久久久久久1区2区 | 久久精品国产亚洲AV不卡| 久久青草国产精品一区| 久久天天躁狠狠躁夜夜躁2014| 国产 亚洲 欧美 另类 久久| 久久棈精品久久久久久噜噜| 欧美激情一区二区久久久| 久久亚洲AV无码西西人体| 久久综合综合久久狠狠狠97色88| 亚洲国产精品无码久久一区二区| 亚洲?V乱码久久精品蜜桃| 久久国产热这里只有精品| 久久亚洲国产欧洲精品一| 国产产无码乱码精品久久鸭| 色8久久人人97超碰香蕉987| 99久久99久久精品国产片果冻| 久久久精品国产免大香伊 | 成人妇女免费播放久久久| 久久发布国产伦子伦精品| 日韩乱码人妻无码中文字幕久久 | 一本一道久久综合狠狠老| 精品久久久久中文字| 久久国产综合精品五月天| 久久久无码精品亚洲日韩软件| 久久99精品免费一区二区| 无码任你躁久久久久久| 性欧美大战久久久久久久久|