0
영어로 볼 수 있도록 문자열로받는 일부 데이터를 기록하려고합니다. 어떻게 내가 이것을 시험해 볼 때 나는 터미널에서 (null)을 얻고있다.nslog nsdata를 문자열로 사용하는 방법
이 내가 바로 그 일을 것 같아 .. 내가 이런 일이 왜 아무 생각이 나는
- (void)connectionDidFinishLoading:(NSURLConnection *)connection
{
// do something with the data
NSLog(@"%@", receivedData); //this pumps out the data representation
NSString *myString = [[NSString alloc] initWithData:receivedData encoding:NSUTF8StringEncoding];
NSLog(@"%@", myString); //this pumps out (null)
}
뭐하는 거지입니다.
전혀 모르겠지만 NSLog (@ "% s", myString)는 어떨까요? – FMCorz
그게 아니라면 "변환은 'char *'유형을 지정하지만 인수에는 'NSString *'유형이 있습니다. –