2

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 in advance!

Knodel
  • 4,359
  • 8
  • 42
  • 66

1 Answers1

4

Try using the URL property:

- NSString *string=[[pathControl URL] path];
Marcel Hansemann
  • 1,019
  • 8
  • 11