Convert an NSURL to an NSString

前端 未结 7 916
伪装坚强ぢ
伪装坚强ぢ 2020-12-02 04:30

I have an app where the user can choose an image either from the built-in app images or from the iphone photo library. I use an object Occasion that has an NSString

7条回答
  •  情话喂你
    2020-12-02 05:09

    In Objective-C:

    NSString *myString = myURL.absoluteString;
    

    In Swift:

    var myString = myURL.absoluteString
    

    More info in the docs:

提交回复
热议问题