Daha büyük bir dizeden bir dize ayıklamak istediğimde, bana bir hata veya sınır dışı hatası verir. Burada gerçekten belirgin bir şey görüyor olabilirim. Teşekkürler.Bir dizgeyi substringWithRange ile ayıklamak: "dizin dışına çıkma" verir
NSString *title = [TBXML textForElement:title1];
TBXMLElement * description1 = [TBXML childElementNamed:@"description" parentElement:item1];
NSString *description = [TBXML textForElement:description1];
NSMutableString *des1 = [NSMutableString stringWithString:description];
//search for <pre> tag for its location in the string
NSRange match;
NSRange match1;
match = [des1 rangeOfString: @"<pre>"];
match1 = [des1 rangeOfString: @"</pre>"];
NSLog(@"%i,%i",match.location,match1.location);
NSString *newDes = [des1 substringWithRange: NSMakeRange (match.location+5, match1.location-1)]; //<---This is the line causing the error
NSLog(@"title=%@",title);
NSLog(@"description=%@",newDes);
GÜNCELLEME: aralığının 2 kısmı uzunluğu değil uç noktasıdır. D'oh!
Sen bir cevap olarak "çözüm" koymak ve onu kabul etmelidir. – LucasTizma