Converting URL to String and back again

后端 未结 10 1347
攒了一身酷
攒了一身酷 2020-12-22 20:29

So I have converted an NSURL to a String. So if I println it looks like file:///Users/... etc.

Later I want this

10条回答
  •  鱼传尺愫
    2020-12-22 21:20

    There is a nicer way of getting the string version of the path from the NSURL in Swift:

    let path:String = url.path
    

提交回复
热议问题