libraryWithAPIVersion:options:error:
Creates and initializes an instance of ITLibrary that can retrieve media entities.
Declaration
+ (instancetype) libraryWithAPIVersion:(NSString *) requestedAPIVersion options:(ITLibInitOptions) options error:(NSError **) error;Parameters
- requestedAPIVersion:
The version of the iTunesLibrary API that the app is requesting. Provide “1.0” if unknown.
- options:
Options that change the initialization behavior. See Itlibinitoptions.
- error:
A pointer to a variable that receives an Nserror if this method fails. Can be
nilif the error isn’t applicable to the caller.
Return Value
An ITLibrary instance that can retrieve media entities, or nil if the method fails.
Discussion
Unless you specify the ITLibInitOptions.lazyLoadData option, the system reads and parses the default iTunes database for the current user during initialization of the ITLibrary class. All media entities cache in memory until deallocation of the object occurs.