iTunes API の記述が不十分です。述語で配列をフィルタリングする必要があります。
NSArray *allSongs = [self allSongs];
NSArray *songsOfAlbum = [allSongs filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"album == %@ && artist == %@", albumString, artistString]];
次のようにすべての曲を取得できます。
// Get all Songs
- (NSArray *)allSongs {
if (_allSongs == nil) {
NSArray *tracksToPlay = [(SBElementArray *)[self.library tracks] get];
// Sort by artist
_allSongs = tracksToPlay;
}
return _allSongs;
}
- (iTunesLibraryPlaylist *)library {
if (_library == nil) {
// Whole Library
iTunesSource *source = [[[[self.iTunes sources] get] filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"kind == %i", iTunesESrcLibrary]] objectAtIndex:0];
// Only the Music
_library = [[[[source playlists] get] filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"specialKind == %i", iTunesESpKMusic]] objectAtIndex:0];
}
return _library;
}