• 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: What can I do with an NSRange in Objective-C?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What can I do with an NSRange in Objective-C?


  • Subject: Re: What can I do with an NSRange in Objective-C?
  • From: Steve Christensen <email@hidden>
  • Date: Sun, 8 Feb 2004 14:49:29 -0800

On Feb 8, 2004, at 2:22 PM, Jerry Krinock wrote:

[snip]

The only thing I can find to do with this NSRange is to convert it to a string using NSStringFromRange (which is an "Objective-C Classic" function), and then parse the string to get the "range" and "length" integers.

Am I missing something?

I do find this declaration:

typedef struct _NSRange {unsigned int location; unsigned int length;}
NSRange;

Can I dig into this struct and access those two ints the old-fashioned way?

Sure. As you noted, NSRange is just a plain-ole struct, so you have access to all fields. Accessor methods would just be overkill.
_______________________________________________
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: 
 >What can I do with an NSRange in Objective-C? (From: Jerry Krinock <email@hidden>)

  • Prev by Date: Re: When/how to use bindings (was Re: MVC question)
  • Next by Date: Re: What can I do with an NSRange in Objective-C?
  • Previous by thread: Re: What can I do with an NSRange in Objective-C?
  • Next by thread: Re: What can I do with an NSRange in Objective-C?
  • Index(es):
    • Date
    • Thread