具有容量的 NSMutableDictionary
当 NSMutableDictionary 已经达到其对象容量限制时,当您尝试添加到它时会发生什么?这是否会导致一个异常,或者是否会引发异常?当我添加新字典对象时,有什么方法可以让它淘汰最旧的字典对象吗?
What happens when you try to add to an NSMutableDictionary once it has already reached its capacity limit of objects? Does this bump one out or is this going to throw an exception? Also is there any way to have it bump out the oldest dictionary object when I add a new one?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它把它颠倒了。构造函数中的容量只是初始容量。
此页面有以下代码片段:
It bumps it up. The capacity in the constructor is only the initial capacity.
This page has the following snippet: