Convert an NSURL to an NSString

前端 未结 7 910
伪装坚强ぢ
伪装坚强ぢ 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:02

    If you're interested in the pure string:

    [myUrl absoluteString];

    If you're interested in the path represented by the URL (and to be used with NSFileManager methods for example):

    [myUrl path];

提交回复
热议问题