开发者

iOS: displaying filename once file is selected

开发者 https://www.devze.com 2023-01-26 06:28 出处:网络
I have a table cell which, once clicked, opens the file browser and lets me select a file to be uploaded to a server. The problem is, I\'m unable to find a way to display the name of whatever was sele

I have a table cell which, once clicked, opens the file browser and lets me select a file to be uploaded to a server. The problem is, I'm unable to find a way to display the name of whatever was selected. For now, I just display "file selected" 开发者_StackOverflow社区and do the upload, but I'd really like to be able to display the file name. Is there a way to do this?


well, not knowing exactly how you do what you are doing, all i can say is, if you use the NSString object that represents the url/path of the object you can use

NSString *name = [objectURL lastPathComponent];

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号