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工作精絕