Total Size of NSMutableArray object

后端 未结 5 1750
盖世英雄少女心
盖世英雄少女心 2021-02-06 21:55

I\'ve got an NSMutableArray that holds a bunch of objects, what I\'m trying to figure out is how much memory is the array using. After looking at a cou

5条回答
  •  闹比i
    闹比i (楼主)
    2021-02-06 22:41

    If the NSArray, and all the objects it contains, and all their sub-objects (recursively etc.) respond to NSCoder, you might be able to serialize the array into a temporary NSData memory chunk, and then get the memory size of that one flat temporary object.

提交回复
热议问题