Alex Rivera | Logout

What is the difference between "copy" and "retain"?

Asked 2010-03-08T05:35:34.170
30

What is the difference between copy and retain for NSString?

- (void)setString:(NSString*)newString
{
    string = [newString copy];
}
Edit
Report

1 Answer

0

retain attribute is specified such that it can retain the another memory i.e it can be made to point to another address also copy First copies the address and then retains it.

answered 2013-07-17T06:42:11.450

Your Answer