Skip to content

December 11, 2011

Copy a NSString to a new string

by noise

To copy a NSString to a new string use the following code:

NSString *str1 = @"This is a string";
NSString *str2;
str2 = [NSString stringWithFormat:@"%@", str1];
Read more from Objective C Tips

Leave a Reply

required
required

Note: HTML is allowed. Your email address will never be published.

Subscribe to comments