开发者

Get full path to a NSPathControl selected file

I have a NSPathControl in my app for the user to select a file on his hard disk.

I am trying to use

-(IBAction) clickedPath:(id) sender {

NSString *string=[[NSString alloc] initWithFormat:[[pathControl clickedPathComponentCell] stringValue]];

NSLog (@"%@", string);

}

But this outputs only the filename. How can I get the full path to the file?

Thanks i开发者_如何学Cn advance!


Try using the URL property:

- NSString *string=[[pathControl URL] path];
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜