本文介绍了NSDouble,NSFloat或NSInteger之外的其他类型是否存在?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在,提到 c> int 类型在32位和64位系统之间大小不同。 float 和 double 不会有相同的大小变化,所以没有必要为它们添加包装类型。


Over at In Cocoa do you prefer NSInteger or just regular int, and why?, there was mention of NSDouble and NSFloat, but I can't see a reference for those in any documentation. If NSInteger's purpose is for architectural safety, what about other types such as double or float?

解决方案

NSInteger exists because the int type varies in size between 32-bit and 64-bit systems. float and double don't vary in size the same way, so there's no need to have wrapper types for them.

这篇关于NSDouble,NSFloat或NSInteger之外的其他类型是否存在?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 09:45