(1)appendString 附加的是一个已经完整的字符串。
(2)appendFormat 附加的是按指定格式、指定参数的字符串。
比如 [str appendString:@"123"];
[str appendFormat:@"name:%@,age:%d", @"张三", 20];
同理,initWithString 和 initWithFormat 也是差不多的。
(1)appendString 附加的是一个已经完整的字符串。
(2)appendFormat 附加的是按指定格式、指定参数的字符串。
比如 [str appendString:@"123"];
[str appendFormat:@"name:%@,age:%d", @"张三", 20];
同理,initWithString 和 initWithFormat 也是差不多的。