• 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: [Q] Calling isEmpty on an NSRange?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Q] Calling isEmpty on an NSRange?


  • Subject: Re: [Q] Calling isEmpty on an NSRange?
  • From: Chris Hanson <email@hidden>
  • Date: Mon, 23 Sep 2002 19:24:04 -0500

At 5:06 PM -0700 9/23/02, Ando Sonenblick wrote:
But I've tried every which way to call isEmpty (and the other "actions")
with a range, but always get compile errors...

I'm not sure what you're asking. Are you trying to send isEmpty to a range, as in this:

BOOL empty = [myRange isEmpty];

If so, that won't work. NSRange, as you've noticed, is a structure, not a class. Since it's not a class, you can't create instances of it or send them messages.

If you want to find out whether a range is empty, just check to see if its length is 0. There are a few useful range functions in Foundation; in Cocoa Browser, they're under Foundation General > Functions > Ranges.

-- Chris

--
Chris Hanson | Email: email@hidden
bDistributed.com, Inc. | Phone: +1-847-372-3955
Making Business Distributed | Fax: +1-847-589-3738
http://bdistributed.com/ | Personal Email: email@hidden
_______________________________________________
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.

References: 
 >[Q] Calling isEmpty on an NSRange? (From: Ando Sonenblick <email@hidden>)

  • Prev by Date: [Q] Calling isEmpty on an NSRange?
  • Next by Date: Re: Driving Word X from Cocoa.
  • Previous by thread: [Q] Calling isEmpty on an NSRange?
  • Next by thread: Re: Just Shoot Me! - was [Q] Calling isEmpty on an NSRange?
  • Index(es):
    • Date
    • Thread