0
문서에서 라이브러리의 모든 미디어 항목을 가져 오는 방법입니다.하지만 노래 만 가져오고 싶습니다. How to get all tracks from an album using iTunes.h/Scripting Bridgeitlibrary.h와 함께 iTunes 라이브러리에서 노래를 가져 오는 방법
내가 그것을 필요하거나 어쩌면 지금 덜 복잡 무엇에 적응하는 방법을 잘 모르겠어요 :
#import <iTunesLibrary/ITLibrary.h>
ITLibrary *library = [ITLibrary libraryWithAPIVersion:@"1.0" error:&error];
if (library)
{
tracks = library.allMediaItems; // <- NSArray of ITLibMediaItem
}
나는이 대답을 찾았나요?
(이전 술어)
그래서 필터링 :
그래서, 당신은 단지 술어를 사용해야합니다 'tracks = [library.allMediaItems filteredArrayUsingPredicate : [NSPredicate predicateWithFormat : @ "mediaKind == % d", ITLib 미디어 항목 미디어 종류 노래]]에 대한 : – Larme
큰 감사드립니다. 나는 그것이 동일 할지도 모른다라고하는 것이라고 상상했다. 그러나 나는 종류의 새로운 이름을 모르고 있었다. 만약 당신이 대답을하면 받아 들일 것입니다 – Neal
'ITLibMediaItem' (https://developer.apple.com/reference/ituneslibrary/itlibmediaitem?language=objc)의 문서를 읽고' NSPredicate'. 거기에 아무 것도 복잡하지 않습니다. – Larme