0

Im looking for the faster way to grab all songs from my iOS music library that do not belong to an album.

I know essentially I can traverse through all the tracks and check for an album title. But I was looking a better way, maybe use a predicate of something like this...

[[MPMediaQuery songsQuery] addFilterPredicate:[MPMediaPropertyPredicate predicateWithValue:@"Unknown Album" forProperty:MPMediaItemPropertyAlbumTitle]];

any help is much appreciated

MiMo
  • 4,905
  • 3
  • 22
  • 23

1 Answers1

1

fastest way I found is by settings a predicate on the [MPMediaQuery songsQuery]

[[MPMediaQuery songsQuery] addFilterPredicate:[MPMediaPropertyPredicate predicateWithValue:@"0" forProperty:MPMediaItemPropertyAlbumPersistentID]];
MiMo
  • 4,905
  • 3
  • 22
  • 23