Friday 4 July 2014

Does Copy will increase the reference count of object ?

The normal semantics of copy and mutableCopy are to give you back a retained object, just like creating a new one via alloc/init would have. They don't increment the reference count of the object being copied, if that's what you're asking. From the NSObject documentation for copy:
If you are using managed memory (not garbage collection), this method retains the new object before returning it. The invoker of the method, however, is responsible for releasing the returned object.

No comments:

Post a Comment

Please comment here...

203 Favorite JavaScript Utilities

https://1loc.dev/