Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 07-07-2009, 05:04 PM   #4 (permalink)
smasher
Senior Member
iPhone Dev SDK Supporter
 
smasher's Avatar
 
Join Date: Jul 2008
Location: San Mateo, CA (San Fran)
Posts: 3,858
Default

Quote:
Originally Posted by PhysX View Post
Code:
NSString *hold=[page substringWithRange:NSMakeRange(page.length-200,page.length-150)]
The function NSMakeRange takes a start location and a *length* , not a start and end location. In your example, if the length is 1000, then you're trying to get a string starting at 800 with length of 850. 800 + 850 = 1650, which is out of range for string with length 1000.

Try this:
Code:
NSString *hold=[page substringWithRange:NSMakeRange(page.length-200,50)]
__________________

Free Games!

Last edited by smasher; 07-08-2009 at 11:15 AM.
smasher is offline   Reply With Quote
 

» Advertisements
» Stats
Members: 158,866
Threads: 89,225
Posts: 380,691
Top Poster: BrianSlick (7,129)
Welcome to our newest member, sethaver
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 06:06 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.