문제

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!

도움이 되었습니까?

해결책

Try using the URL property:

- NSString *string=[[pathControl URL] path];
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top