AFURLConnectionOperation.m Implicit conversion loses integer precision: 'int64_t' (aka 'long long') to 'NSInteger' (aka 'int')

老子叫甜甜 提交于 2019-12-23 15:40:02

问题


I got a warning in Xcode 5.1 as stated below

AFNetworking 2.2.0: AFURLConnectionOperation.m Implicit conversion loses integer precision: 'int64_t' (aka 'long long') to 'NSInteger' (aka 'int') 

Is this important?


回答1:


This mean is arm64 architecture int64_t range is -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 but int range is -2,147,483,648 to 2,147,483,647. so compiler say to Loss of value.

See a this: ConvertingYourAppto-64Bit

if you don't want more warning. you can must change to architecture in Xcode 5.1




回答2:


You can make the following change manually until the next CocoaPod release (the change is already in GitHub).

change:

[decoder decodeInt64ForKey:NSStringFromSelector(@selector(totalBytesRead))];

to:

[decoder decodeIntegerForKey:NSStringFromSelector(@selector(totalBytesRead))];



回答3:


AFNetworking v2.2.1 fixes this issue.

https://github.com/AFNetworking/AFNetworking/blob/master/CHANGES




回答4:


you probably select as simulator : iPhone Retina (4-inch 64-bit). Try with the 32 bits



来源:https://stackoverflow.com/questions/22350056/afurlconnectionoperation-m-implicit-conversion-loses-integer-precision-int64-t

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!