iphone – 无法获得NSNumber的无符号长值
发布时间:2020-12-14 19:46:25 所属栏目:百科 来源:网络整理
导读:我想获得NSNumber的unsigned long值.我不知道为什么,但它不起作用.这是我做的: NSString * stern = [idd objectAtIndex:indexPath.row]; // get a String with Number from a NSArrayNSNumberFormatter * lols = [[NSNumberFormatter alloc] init];NSNumber
我想获得NSNumber的unsigned long值.我不知道为什么,但它不起作用.这是我做的:
NSString * stern = [idd objectAtIndex:indexPath.row]; // get a String with Number from a NSArray NSNumberFormatter * lols = [[NSNumberFormatter alloc] init]; NSNumber * iddd = [lols numberFromString:stern]; NSLog(@"%@",iddd); // I get the right number: 8084143463 unsigned long fooo = [iddd unsignedLongValue]; NSLog(@"%lu",fooo); // I get the wrong number: 3789176167 [twitterEngine deleteUpdate:fooo]; 解决方法8084143463 == 0x1e1da3d67 3789176167 == 0x0e1da3d67 64位系统上的长度大小为8个字节. 32位系统(如iPhone)的长度为4个字节.您需要在iPhone上使用很长的时间来存储该值. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容