我有这段代码,我正在检查我的应用程序中存在的歌曲并将歌曲的数量存储在 NSMUTABLEArray 中,但是有问题总是显示为 null
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 变量工作得很好