Converting string to int changes the value

我的未来我决定 提交于 2019-11-29 18:01:23

The number is much too large to fit in a 32 bit int. What you want to do is use a long instead:

long maxTweetID = [[[_dataArray lastObject]tweetID]longValue];

EDIT:

You actually need to use long long in Objective-C:

long long maxTweetID = [[[_dataArray lastObject]tweetID]longLongValue];

The number in the string is too large to be stored as an integer. The highest integer possible with 32 bits is 2.147.483.647. Try using a long.

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