ios - NSMUtableDictionary 中如果键值中内有内容,那么键名还会存在么?
PHPz
PHPz 2017-04-17 17:45:03
0
3
400

NSMUtableDictionary 中如果键值中内有内容,那么键名还会存在么?
就是一个key 对应一个value 如果value没有了键值还会存在么?

PHPz
PHPz

学习是最好的投资!

reply all(3)
大家讲道理

When

value = nil, it crashes

Ty80

If you have such a problem, you can try it yourself. How do you define "no more"? When an object is placed in a collection (NSArray, NSDictionary, NSSet, etc.), it will be automatically retained once, and the reference count will be increased by one. If it is not removed from the collection, its reference count will be at least 1, which is not normal. It is "no more" for no reason (unless there is a problem with the code writing and the release is transitioned in some places). If you want it to be "none", you have to remove it from the collection first, so that your problem does not exist.

As for what happens when an object added to a collection is released externally, why don't you give it a try?

Peter_Zhu

key value ;
value cannot be equal to nil, it will bounce. Of course you don’t know what your empty space means

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template