我有图像称为:
图片0001.png 图片0002.png ... 图片0234.png...
如何使 for 循环理解应该有多少个“0”?
//this code crash
for (int i = 0; i < 234; i++)
{
[myImages addObject:[UIImage imageNamed:[NSString stringWithFormat:@"image000%i", i]]];
}
谢谢
我有图像称为:
图片0001.png 图片0002.png ... 图片0234.png...
如何使 for 循环理解应该有多少个“0”?
//this code crash
for (int i = 0; i < 234; i++)
{
[myImages addObject:[UIImage imageNamed:[NSString stringWithFormat:@"image000%i", i]]];
}
谢谢
for (int i = 0; i < 10; i++)
{
[myImages addObject:[UIImage imageNamed:[NSString stringWithFormat:@"image000%i", i]]];
}
for (int i = 10; i < 100; i++)
{
[myImages addObject:[UIImage imageNamed:[NSString stringWithFormat:@"image00%i", i]]];
}
for (int i = 100; i <= 234; i++)
{
[myImages addObject:[UIImage imageNamed:[NSString stringWithFormat:@"image0%i", i]]];
}