0
이 코드가 무슨 문제입니까? xml 데이터를 문자열로 변환하여 로그에 인쇄한다고 가정합니다. 그러나 아무 것도 인쇄하지 않습니다.objective-c xml을 string으로 변환하는 방법은 무엇입니까?
-(IBAction)request:(id)sender
{
NSURL *url = [NSURL URLWithString:@"http://api.twitter.com/1/statuses/public_timeline.xml"];
theRequest = [[NSMutableURLRequest alloc] initWithURL:url];
theConnection = [[NSURLConnection alloc] initWithRequest:theRequest delegate:self];
receivedData=[[NSMutableData data] retain];
NSString *s = [[NSString alloc] initWithData:receivedData encoding:NSUTF8StringEncoding];
NSLog(@"%@", s);
[s release];
//parser = [[NSXMLParser alloc] initWithData:receivedData];
//[parser setDelegate:self];
//[parser parse];
}
및 아이디어? 사전
감사합니다. 나는 왜이 명백한 실수에주의를 기울이지 않았는지 알지 못합니다. 데이터를 받기 위해 대리인 메서드를 사용해야합니다. 덕분에 지금 작동 중입니다. :) – ahmed