What is the difference between copy and retain ?
What is the difference between copy and retain ?
Here is the difference between the copy
and retain
methods in Objective-C:
copy
copy
method creates a new object that is an exact copy of the original object.NSString
or NSArray
.copy
method creates a new mutable object with the same contents.copy
method is typically used to ensure that an object's state is not accidentally modified by another part of the code.retain
retain
method increases the reference count of an object, indicating tha...junior
Gợi ý câu hỏi phỏng vấn
Chưa có bình luận nào