获取ipod中的音乐文件格式

-(void *)getIpodMusicFormatWithIn

dex: (NSInteger)index{
      MPMediaItem * item = [itemsArray objectAtIndex: index];
      NSURL *url = [item valueForProperty: MPMediaItemPropertyAsset URL];
      NSString *str =[url absoluteString];
      NSRange temp1 =  [str rangeOfString:@"."];
      NSRange temp2 =  [str rangeOfString:@"?"];
      NSRange temp ;
      temp.length = temp2.location - temp1.location-1;
      temp.location = temp1.location + 1;
      NSString *finalSrt = [str substringWithRange:temp];
      DMLog *LogData = [DMLog sharedLogData];
      if (finalSrt == nil) {
            finalSrt = @"";
      }
      [LogData.sonyPlayDict setValue:finalSrt forKey:@"IpodMusicFormat"];
}
详细的解释说不出来。自己一半懂不懂,反正是实现了。先记下来慢慢研究。。

你可能感兴趣的:(ios,职场,休闲,ipod)