• 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: Can't cram an NSRange into an NSArray?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can't cram an NSRange into an NSArray?


  • Subject: Re: Can't cram an NSRange into an NSArray?
  • From: "James Winetke" <email@hidden>
  • Date: Tue, 02 Jul 2002 02:05:07 +0000

I have a followup question. CFStringCreateArrayWithFindResults() returns
a CFArray filled with CFRange structures, which works great; I can see
the ranges in the debugger and they're perfect.

I can't figure out how to get the ranges out of the array. The compiler
balks with "incompatible types in assignment" when I try things like
this:

CFRange myRange;
CFArrayRef thisArray

thisArray = CFStringCreateArrayWithFindResults(...);
myRange = CFArrayGetValueAtIndex(thisArray, (CFIndex) 0);

Ditto for the NSEnumerator approach, where I'm assigning [en nextObject]
to a CFRange (or NSRange). What darn data type does it want?

It's so frustrating to waste hours on an error like "incompatible types
in assignment" -- if the compiler _knows_ they're incompatible, it should
tell me what they fricking _are_ when it complains.

I tried extracting the mystery object into a variable with gdb, but the
only return type that the array would give it up to was id, which
resisted all inspection except for its address in memory.

Jim

_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Can't cram an NSRange into an NSArray?
      • From: Shawn Erickson <email@hidden>
  • Prev by Date: Re: Unicode
  • Next by Date: Re: RFC: Allocating via a protocol/interface
  • Previous by thread: Re: Unicode
  • Next by thread: Re: Can't cram an NSRange into an NSArray?
  • Index(es):
    • Date
    • Thread