Pregunta

I am looking for a way to set the path of an NSPathControl to be "~/Desktop".

¿Fue útil?

Solución

[_pathControlOutlet setURL: [NSURL URLWithString: [@"~/Desktop"stringByExpandingTildeInPath] ]];


NSURL *pathURL = [_pathControlOutlet URL];
NSLog(@"%@",[[_pathControlOutlet URL]path]);

NSString *pathSegmentClicked = [[_pathControlOutlet clickedPathComponentCell]title];

NSLog(@"%@",pathSegmentClicked);
NSLog(@"%@",pathURL);

Otros consejos

NSURL *pathURL = [NSURL fileURLWithPath:[@"~/Desktop stringByExpandingTildeInPath]];
[pathControl setURL:pathURL];
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top