-(void)artworkImages{
NSArray *noOfSongs = [mySongsArray content];
for (int i=0; i<[noOfSongs count]; i++) {
NSDictionary *dic = [[NSDictionary alloc] init];
dic = [[mySongsArray arrangedObjects] objectAtIndex:i];
NSURL *url = [NSURL fileURLWithPath:[dic objectForKey:@"Path"]];
AVURLAsset *asset = [AVURLAsset URLAssetWithURL:url options:nil];
for (NSString *format in [asset availableMetadataFormats]) {
for (AVMetadataItem *item in [asset metadataForFormat:format]) {
if (i>240 && i<250) {
NSBeginAlertSheet(@"Check the loop", @"Delete", nil, @"Cancel", window, self, @selector(alertEnd:returnCode:cInfo:), NULL, nil, @"format===%@,%d",format);
}
}
}
}
}
Above methods is working fine if I run the project by Code (X code), but getting issue if I run by build. I am importing songs from iTunes library.xml, after that I am storing into NSArrayController
. Here in this method I am trying to fetch artwork images but if I run by build I am getting around 250 images out of 400.
some possibilities:
you are importing/reading a different "iTunes library.xml" file that was created with a smaller set of itunes files. and maybe that filename is set in the xcode arguments???
[noOfSongs count] has an inconsistent value, because objects are removed from noOfSongs
try :
rather than the current: