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?
When
value = nil, it crashes
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?
key value ;
value cannot be equal to nil, it will bounce. Of course you don’t know what your empty space means