function to get the file name of an URL

前端 未结 6 1830
时光说笑
时光说笑 2021-01-30 05:23

I have some source code to get the file name of an url

for example:

http://www.google.com/a.pdf

I hope to get a.pdf

because the way to join 2 NSS

6条回答
  •  说谎
    说谎 (楼主)
    2021-01-30 05:47

    This is more error free and meant for getting the localized name in the URL.

    NSString *localizedName = nil;
    [url getResourceValue:&localizedName forKey:NSURLLocalizedNameKey error:NULL];
    

提交回复
热议问题