Try this (warning: typed into browser)
NSArray *metadata = [asset metadataForFormat:AVMetadataFormatID3Metadata];
if (metadata == nil) {
NSLog(@"No ID3 metadata for asset: %@", asset);
}
// From https://developer.apple.com/library/ios/documentation/AVFoundation/Reference/AVFoundation_ID3Constants/Reference/reference.html
NSArray *filteredMetadata = [AVMetadataItem metadataItemsFromArray:metadata withKey:AVMetadataID3MetadataKeyInternationalStandardRecordingCode keySpace:nil];
AVMetadataItem *item = [filteredMetadata firstObject];
if (item != nil) {
NSLog(@"ISRC: %@", item.stringValue);
} else {
NSLog(@"No ISRC found for: %@", asset);
}
EDIT: I should mention, the reason your original code didn't print the value of the ISRC is because the ISRC is not part of the common metadata space, and won't be included in the array returned by [asset commonMetadata]
. The ISRC key is specific to ID3 metadata, so if your asset does not have ID3 metadata associated with it, you will be unable to retrieve that information.