-(void)connectionDidFinishLoading:(NSURLConnection *)connection
{
NSLog(@"3 DONE. Received Bytes: %d", [getMagaListsWebData length]);
NSString *recievedXML = [[NSString alloc]initWithData:getMagaListsWebData encoding:NSUTF8StringEncoding];
[recievedXML release];
//重新加載xmlParser
if(getMagaListsXmlParser){
[getMagaListsXmlParser release];
getMagaListsXmlParser = nil;
}
getMagaListsXmlParser = [[NSXMLParser alloc]initWithData:getMagaListsWebData];
[getMagaListsXmlParser setDelegate: self];
[getMagaListsXmlParser setShouldResolveExternalEntities: YES];
[getMagaListsXmlParser parse];
if (![getMagaListsXmlParser parse]) {
NSLog(@"parse error = %@", [getMagaListsXmlParser parserError]);
//theConnection = [[NSURLConnection alloc] initWithRequest:getMagaListsRequest delegate:self startImmediately:YES];
}
}
我收到错误消息:
parse error = Error Domain=NSXMLParserErrorDomain
Code=5 "The operation couldn’t be completed. (NSXMLParserErrorDomain error 5.)"