Re: [Q] Calling isEmpty on an NSRange?
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.