Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > NSRange trouble

NSRange trouble
Thread Tools
Professional Poster
Join Date: Sep 2000
Location: San Francisco
Status: Offline
Reply With Quote
Apr 27, 2002, 07:47 PM
 
2002-04-27 17:41:23.302 CocoaMed[1524] idList=10696437,3743643,

2002-04-27 17:41:23.302 CocoaMed[1524] idList=1069643,

I have only one line of code between the above two NSLog outputs:
[idList deleteCharactersInRange:NSMakeRange(6,9)];

I don't understand how deleting characters 6-9 results in the change in idList. The 3 is character 6, but the what happens to the rest of the string?

thanks,
kman
     
kman42  (op)
Professional Poster
Join Date: Sep 2000
Location: San Francisco
Status: Offline
Reply With Quote
Apr 27, 2002, 07:54 PM
 
Okay, I get it. NSMakeRange x,y) uses x as the first character and then counts up by y characters. Tricky. Especially when there is no documentation for it.

kman
     
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Apr 28, 2002, 01:29 AM
 
Originally posted by kman42:
<STRONG>Okay, I get it. NSMakeRange x,y) uses x as the first character and then counts up by y characters. Tricky. Especially when there is no documentation for it.</STRONG>
Actually, there is documentation for it. From Foundation Functions:
NSMakeRange
Creates a new NSRange from the specified values.

NSRange NSMakeRange(unsigned int location, unsigned int length)

Discussion

Creates an NSRange having the specified location and length.
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
kman42  (op)
Professional Poster
Join Date: Sep 2000
Location: San Francisco
Status: Offline
Reply With Quote
Apr 29, 2002, 12:43 PM
 
Thanks, Chuck. That's a good link.

kman
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 11:14 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2