NSCFArray?

  • What is an NSCFArray? It turns up in IB if I instantiate an NSArray.
    Even if I search for it on Apple Developer it asks Did you mean
    NSArray. I imagine it's got something to do with toll-free bridging.
    Is this correct?

    Ian
  • On Sep 24, 2007, at 7:57 PM, Ian Joyner wrote:

    > What is an NSCFArray? It turns up in IB if I instantiate an
    > NSArray. Even if I search for it on Apple Developer it asks Did you
    > mean NSArray. I imagine it's got something to do with toll-free
    > bridging. Is this correct?

    Correct.

    Nick Zitzmann
    <http://www.chronosnet.com/>
  • On 25/09/2007, at 12:56 PM, Nick Zitzmann wrote:

    >
    > On Sep 24, 2007, at 7:57 PM, Ian Joyner wrote:
    >
    >> What is an NSCFArray? It turns up in IB if I instantiate an
    >> NSArray. Even if I search for it on Apple Developer it asks Did
    >> you mean NSArray. I imagine it's got something to do with toll-
    >> free bridging. Is this correct?
    >
    > Correct.

    It's also partly to do with class clustering. An NSMutableArray also
    ends up as an NSCFArray.

    - Chris
  • On 25 Sep 2007, at 04:11, Chris Suter wrote:

    > On 25/09/2007, at 12:56 PM, Nick Zitzmann wrote:
    >
    >>
    >> On Sep 24, 2007, at 7:57 PM, Ian Joyner wrote:
    >>
    >>> What is an NSCFArray? It turns up in IB if I instantiate an
    >>> NSArray. Even if I search for it on Apple Developer it asks Did
    >>> you mean NSArray. I imagine it's got something to do with toll-
    >>> free bridging. Is this correct?
    >>
    >> Correct.
    >
    > It's also partly to do with class clustering. An NSMutableArray
    > also ends up as an NSCFArray.

    It's probably a good idea to emphasise that this (NSCFArray) is an
    implementation detail, and as such it's possible that it may change.
    Also, there's no guarantee that your code will never see some other
    NSArray subclass (e.g. perhaps someone might use a custom NSArray to
    hold a C-style array of integers).

    Kind regards,

    Alastair.

    --
    http://alastairs-place.net
previous month september 2007 next month
MTWTFSS
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
Go to today