NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectoryPath = [paths objectAtIndex:0];
NSFileManager *manager = [NSFileManager defaultManager];
self.frlistName2 = [[manager contentsOfDirectoryAtPath:documentsDirectoryPath error:nil]pathsMatchingExtensions:[NSArray arrayWithObject:@"txt"]];
NSString *obj = @".txt";
frlisturls2 = [[NSMutableArray alloc] initWithObjects:nil];
NSString *temp;
NSMutableString *mp3Path = [[NSMutableArray alloc] init];
int j =0;
for(int i =0 ; i< [frlistName2 count]; i++)
{
mp3Path = [NSMutableString stringWithString:documentsDirectoryPath];
[mp3Path appendString:@"/"];
temp = [frlistName2 objectAtIndex:i];
if([temp hasSuffix :obj])
{
[mp3Path appendString: temp];
[frlisturls2 addObject: mp3Path];
j++;
}
[mp3Path release];
NSLog(@"frlisturls2 is%@:",frlisturls2);
}
Выше кода отобразите файлы из общего доступа к файлам iTunes и сохраните их URL в массиве