开发者

Can I do an easy init a string with format using @"

开发者 https://www.devze.com 2022-12-22 02:05 出处:网络
wh开发者_JAVA技巧en defining a string in Objective-C, can I do an easy assignment using a string format, such as

wh开发者_JAVA技巧en defining a string in Objective-C, can I do an easy assignment using a string format, such as

NSString *myVar = @"My String has %d words", 4;


nope

NSString *myVar = [NSString stringWithFormat:@"My String has %d words", 4];
0

精彩评论

暂无评论...
验证码 换一张
取 消