문제

I used ASIHTTPRequest in my project,but in the file ASIDataCompressor.m line 190:

if ([inputStream streamStatus] == NSStreamEventErrorOccurred) {
        if (err) {
            *err = [NSError errorWithDomain:NetworkRequestErrorDomain code:ASICompressionError userInfo:[NSDictionary dictionaryWithObjectsAndKeys:[NSString stringWithFormat:@"Compression of %@ failed because we were unable to write to the destination data file at %@",sourcePath,destinationPath],NSLocalizedDescriptionKey,[outputStream streamError],NSUnderlyingErrorKey,nil]];
        }
        [compressor closeStream];
        return NO;
    }

it warning me this:

Warning

Any one know how to fix it? thx

도움이 되었습니까?

해결책

(NSStreamStatus)NSStreamEventErrorOccurred

edit

Probably the correct way to handle this is to replace the NSStreamEventErrorOccurred with NSStreamStatusError. That's probably what the author of ASIHTTP intended.

다른 팁

NSStreamEventErrorOccurred is of type NSStreamEvent with a constant value of 8. The streamStatus method returns an NSStreamStatus not NSStreamEvent and NSStreamStatus values do not exceed a value of 7 which is why you got the error. You were fortunate that 8 exceeded the bounds and you got an error because that not is always the case, therefore, you should always be cautious of the return type.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top