Tag: sizeof

如何计算NSDictionary对象的总大小?

如何计算NSDictionary对象的总大小? 我有不同的密钥在NSDictionary 3000 StudentClass对象。 我想计算字典的总大小(以KB为单位)。 我用malloc_size()但它总是返回24( NSDictionary包含1对象或3000对象) sizeof()也总是返回相同的。

Swift使用Int32数组的大小

我想获得“sizeof”的数组的长度。 我尝试了一切。 这是错误消息:“[Int32]不能转换为T.Type” 数组必须是Int32。 var testArray: [Int32] = [2000,400,5000,400] var arrayLength = sizeof(testArray)