这里是我的代码:组合两个NSString的和一些
NSString *targetPath [email protected]"/Users/miguelcosta/Desktop/Image.png";
在此的NSString我想要做这样的事情:
NSString *targetPath [email protected]"/Users/miguelcosta/Desktop/Image", RandomNumber + @"png";
我怎么能这样做?
这里是我的代码:组合两个NSString的和一些
NSString *targetPath [email protected]"/Users/miguelcosta/Desktop/Image.png";
在此的NSString我想要做这样的事情:
NSString *targetPath [email protected]"/Users/miguelcosta/Desktop/Image", RandomNumber + @"png";
我怎么能这样做?
假设你的随机数是int,你可以使用下面的
NSString* fullPath = [NSString stringWithFormat:@"/Users/miguelcosta/Desktop/Image%d.png", random];
'+ [NSString的stringWithFormat:]'究竟存在这方面的 – Sulthan
@sulthan:作出回答。 –