• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSArray and C array
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSArray and C array


  • Subject: Re: NSArray and C array
  • From: Ondra Cada <email@hidden>
  • Date: Sun, 28 Oct 2001 10:38:18 +0100

Drew,

>>>>>> Drew McCormack (DMC) wrote at Sat, 27 Oct 2001 21:39:47 -0700:
DMC> I think I can remember seeing in the documentation an example which cast
DMC> an NSArray to a C array, but I can't seem to find it. I think it was
DMC> something along these lines:
DMC>
DMC> NSArray *array = [NSArray arrayWithObject:obj];
DMC> id *carray;
DMC> carray = (id *)array;
DMC> [carray[0] doSomething];
DMC>
DMC> Is this possible?

Nope, it is plain impossible. You can cast an NSArray to a CFArray, which is
quite a different beast than the plain C array: CoreFoundation is, to some
extent, still the same object oriented API, just with an ugly plain C
interface.
---
Ondra Cada
OCSoftware: email@hidden http://www.ocs.cz
2K Development: email@hidden http://www.2kdevelopment.cz
private email@hidden http://www.ocs.cz/oc


References: 
 >NSArray and C array (From: Drew McCormack <email@hidden>)

  • Prev by Date: Re: NSBundle Examples
  • Next by Date: Re: NSWorkspace getInfoForFile weirdness
  • Previous by thread: NSArray and C array
  • Next by thread: NSWorkspace getInfoForFile weirdness
  • Index(es):
    • Date
    • Thread