if ([inputStream streamStatus] == NSStreamEventErrorOccurred) { instead为 if ([inputStream streamStatus] == (NSStreamStatus)NSStreamEventErrorOccurred) { return [[NSDate date] addTimeInterval:maxAge]; instead为 return [[NSDate date] dateByAddingTimeInterval:maxAge];