I know that copy creates an immutable copy of an object but i just want to know how copywithzone works and what is the basic difference between copy and copywithzone
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
copyis just short forcopyWithZone:, using the default zone.it’s rare that you would call
copyWithZone:directly, although defining/implementing it is required in order to adopt@protocol NSCopying. so you would normally seecopyWithZone:only within an implementation ofcopyWithZone:. similarly, you would typically avoid implementingcopy, and just let the default implementation ofcopycall throughcopyWithZone:.