I am trying to assign a variable with type 'long long' to a type NSUInteger, What is the correct way to do that?
my code line:
expectedSize = response.expectedContentLength > 0 ? response.expectedContentLength : 0;
where expectedSize
is of type NSUInteger and return type of response.expectedContentLength
is of type 'long long
'. The variable response
is of type NSURLResponse
.
The compile error shown is:
Semantic Issue: Implicit conversion loses integer precision: 'long long' to 'NSUInteger' (aka 'unsigned int')
expectedSize = response.expectedContentLength > 0 ? (NSUInteger)response.expectedContentLength : 0;
– Directoire