我得到警告::不兼容的指針類型在下面的代碼分配給從「NSData的」 NSMutableData「在收到警告不兼容的指針類型從NSData的
-(void) connectionDidFinishLoading:(NSURLConnection *) connection
{
NSLog(@"DONE. Received Bytes: %d", [webData length]);
NSString *theXML = [[[NSString alloc] initWithBytes: [webData mutableBytes] length [webData length] encoding:NSUTF8StringEncoding] autorelease];
theXML = [theXML stringByReplacingOccurrencesOfString:@"<" withString:@"<"];
theXML = [theXML stringByReplacingOccurrencesOfString:@">" withString:@">"];
NSLog(@"%@",theXML);
if(xmlParser)
{
xmlParser = nil;
[xmlParser release];
}
NSMutableString *str = [[NSMutableString alloc]initWithString:theXML];
webData = [str dataUsingEncoding:NSUTF16StringEncoding];//WARNING
xmlParser = [[[NSXMLParser alloc] initWithData:webData] autorelease];
[xmlParser setDelegate:self];
[xmlParser setShouldResolveExternalEntities: YES];
[xmlParser parse];
[connection release];
}
你應該接受來自您前面問題的一些答案。 – 2012-05-09 10:35:29
如何接受? – amrita
查看SO常見問題解答(http://stackoverflow.com/faq#howtoask)。 – 2012-05-09 11:13:49