Positive here is my NSLog before and after the deleteCharactersInRange: function with "Preview" as the selection I am looking for. If I include the : in the selection I'm looking for the app crashes.
Code:
2011-04-08 10:15:10.861 TopSongs[1664:207] Before= Preview: Blue Estate
2011-04-08 10:15:10.862 TopSongs[1664:207] After= : Blue Estate
EDIT:
actually I just tried running with the : included and looked at my NS log.. I think I know what might be the problem.
here is the log.
Code:
[Session started at 2011-04-08 10:20:04 +1200.]
2011-04-08 10:20:06.067 TopSongs[1747:207] Before= CBR Previews
2011-04-08 10:20:06.069 TopSongs[1747:207] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[NSCFString deleteCharactersInRange:]: Range or index out of bounds'
*** Call stack at first throw:
(
0 CoreFoundation 0x00dafbe9 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x00f045c2 objc_exception_throw + 47
2 CoreFoundation 0x00d68628 +[NSException raise:format:arguments:] + 136
3 CoreFoundation 0x00d6859a +[NSException raise:format:] + 58
4 Foundation 0x000a5444 mutateError + 218
5 TopSongs 0x00002a23 -[RSSTableViewController parser:didEndElement:namespaceURI:qualifiedName:] + 220
6 Foundation 0x000f1a19 _endElementNs + 453
7 libxml2.2.dylib 0x01241e63 xmlParseXMLDecl + 1346
8 libxml2.2.dylib 0x0124cb6d xmlParseChunk + 3984
9 Foundation 0x000f121a -[NSXMLParser parse] + 321
10 TopSongs 0x000027ea -[RSSTableViewController connectionDidFinishLoading:] + 145
11 Foundation 0x0005a172 -[NSURLConnection(NSURLConnectionReallyInternal) sendDidFinishLoading] + 108
12 Foundation 0x0005a0cb _NSURLConnectionDidFinishLoading + 133
13 CFNetwork 0x0137a606 _ZN19URLConnectionClient23_clientDidFinishLoadingEPNS_26ClientConnectionEventQueueE + 220
14 CFNetwork 0x01445821 _ZN19URLConnectionClient26ClientConnectionEventQueue33processAllEventsAndConsumePayloadEP20XConnectionEventInfoI12XClientEvent18XClientEventParamsEl + 293
15 CFNetwork 0x01370e3c _ZN19URLConnectionClient13processEventsEv + 100
16 CFNetwork 0x01370cb7 _ZN17MultiplexerSource7performEv + 251
17 CoreFoundation 0x00d9101f __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
18 CoreFoundation 0x00cef28b __CFRunLoopDoSources0 + 571
19 CoreFoundation 0x00cee786 __CFRunLoopRun + 470
20 CoreFoundation 0x00cee240 CFRunLoopRunSpecific + 208
21 CoreFoundation 0x00cee161 CFRunLoopRunInMode + 97
22 GraphicsServices 0x016e4268 GSEventRunModal + 217
23 GraphicsServices 0x016e432d GSEventRun + 115
24 UIKit 0x002c742e UIApplicationMain + 1160
25 TopSongs 0x00002260 main + 102
26 TopSongs 0x000021f1 start + 53
)
terminate called after throwing an instance of 'NSException'
as you can see there is a <title>CBR Previews</title> which doesn't include the Preview: string. I need to figure out how to make an exception for this...
what do you think, think its the problem?