0
我有这样的代码从我检查存在于我的应用程序的歌曲,并存储在一个NSMutableArray歌曲的编号,但有一些东西错了,它总是显示为空从循环中获得价值来存储阵列
for (int i = 1; i < 100; ++i) {
// Load the plist
NSString *plist = [[NSBundle mainBundle] pathForResource:[NSString stringWithFormat:@"%d",i] ofType:@"mp3"];
if (nil == plist) {
NSLog(@"not found (%i)", i);
continue;
}
NSLog(@"Found Songs (%i)",i);
[MYNSMUTABLEArray addObject:[NSNumber numberWithInt:i]];
NSLog(@"%@",MYNSMUTABLEArray);
}
变量i工作精绝