Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/102.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 隐式转换丢失整数精度:';无符号长';至';int';_Ios_Objective C - Fatal编程技术网

Ios 隐式转换丢失整数精度:';无符号长';至';int';

Ios 隐式转换丢失整数精度:';无符号长';至';int';,ios,objective-c,Ios,Objective C,我正在将旧的iOS5代码升级到iOS8 我的原始代码: NSInteger maximumValue = -1; if (results.count == 1) { Answer *result = (Answer*)[results objectAtIndex:0]; maximumValue = [result.order integerValue]; } return maximumValue+1; } 返回错误隐式转换丢失整数精度:long到int 如果我将其从NSI

我正在将旧的iOS5代码升级到iOS8

我的原始代码:

NSInteger maximumValue = -1;
if (results.count == 1) {
    Answer *result = (Answer*)[results objectAtIndex:0];
    maximumValue =  [result.order integerValue];
}
return maximumValue+1;
}
返回错误隐式转换丢失整数精度:long到int

如果我将其从
NSInteger
更改为
NSInteger
,我会得到错误隐式转换丢失整数精度:

'无符号长'to int'


我已经能够将所有int更新为
NSUInteger
,这两个问题是我仅存的两个问题,我正在努力解决。

您几乎可以肯定的是,您的方法或函数(无论返回的是什么)的返回类型是
int
。它的返回类型应该是
NSInteger

什么类型的对象是
result.order
?奇怪。尝试将所有
NSInteger
s更改为
int
s,并在
result.order上调用
intValue
。是
result.order
一个
NSString
?这些是警告,而不是错误。如果您使用的是64位
NSUInteger
是一个
无符号长
是哪一行给出的错误以及返回的方法的返回类型是什么?