How to convert NSUrl to NSString?

前端 未结 5 1446
鱼传尺愫
鱼传尺愫 2021-02-06 22:20

After AVAssetExportSession has complete export video. I have plan to garb Video Path to upload via Youtube. but [GDataUtilities MIMETypeForFileAtPath:path def

5条回答
  •  清歌不尽
    2021-02-06 23:25

    Use either absolutePath or path as mentioned by Miek and Nepster. Expanding on their answers, the difference between lies in the prefix.

    NSString* string1 = [url absoluteString]; // @"file:///Users/jackbrown/Music/song name.mp3"
    NSString* string2 = [url path]; // @"/Users/jackbrown/Music/song name.mp3"`
    

提交回复
热议问题