2014-01-13 2 views
0

위의 경고 메시지가 계속 나타나지만이를 수정하는 방법을 알 수 없습니다. 대신 "%의 @"의 "@ &"형식 인수에 사용되지 않는 데이터 인수 형식 오류 메시지

*err = [NSError errorWithDomain:NetworkRequestErrorDomain code:ASICompressionError userInfo:[NSDictionary dictionaryWithObjectsAndKeys: 
[NSString stringWithFormat:@"Decompression of %@ failed because we were unable to write to the destination data file at &@",sourcePath,destinationPath], 
NSLocalizedDescriptionKey, 
[outputStream streamError], 
NSUnderlyingErrorKey, 
nil]]; 

답변

1

오류는 오타입니다.

더 이런 식으로 코드를 작성 생각해 오류가 줄에 단독으로되어 쉽게 발견 할이 코드 형식으로

NSString *messageText = [NSString stringWithFormat:@"Decompression of %@ failed because we were unable to write to the destination data file at %@", sourcePath, destinationPath]; 
NSString *streamErrorText = [outputStream streamError]; 
NSDictionary *userInfo = @{NSLocalizedDescriptionKey : messageText, 
          NSUnderlyingErrorKey  : streamErrorText}; 
NSError *err = [NSError errorWithDomain:NetworkRequestErrorDomain code:ASICompressionError userInfo:userInfo]; 

합니다.

컴파일러가 아닌 사람들이 읽을 수있는 코드를 작성하십시오.

+0

나는 그것을 보지 못했다고 생각할 수 없다. 이것은 작성하지 않은 ASIHTTPRequest 코드 라이브러리에 있으므로 서식을 지정하지 않았습니다. – user717452