Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想将 a 转换NSString为int64_t,然后使用以下命令打印出来:
NSString
int64_t
NSLog("%lld", i);
现在我只能转换 using [str integerValue]which 有时会打印出负数。
[str integerValue]
您可以使用[str longLongValue]
[str longLongValue]
例如:
int64_t i=[@"23570449442514" longLongValue];
longLongValue 有效![str longLongValue];
您可以使用该atoll功能。
atoll
int64_t i = atoll([str UTF8String]);