When we call alloc
with a Class
, Whether the object's reference count will be 1.
For example:
NSObject *obj = [NSObject alloc];
After this line of code is executed, the reference count of the object is 0 or 1?
I read the alloc
source code, But did not find the alloc
method will have any action on the object's reference count,At this point the object of the reference count is still 0?
if 0, then the object will be destroyed, but if not 0, how it is achieved,
I hope someone can help me answer the hearts of confusion, thank you!