I am looking for a way to set the path of an NSPathControl to be "~/Desktop".
Asked
Active
Viewed 1,531 times
2 Answers
4
[_pathControlOutlet setURL: [NSURL URLWithString: [@"~/Desktop"stringByExpandingTildeInPath] ]];
NSURL *pathURL = [_pathControlOutlet URL];
NSLog(@"%@",[[_pathControlOutlet URL]path]);
NSString *pathSegmentClicked = [[_pathControlOutlet clickedPathComponentCell]title];
NSLog(@"%@",pathSegmentClicked);
NSLog(@"%@",pathURL);
-
Thank you very much.Now I am wondering, How do I get the a string of the selected path. – k4lls Jan 10 '13 at 22:23
2
NSURL *pathURL = [NSURL fileURLWithPath:[@"~/Desktop stringByExpandingTildeInPath]];
[pathControl setURL:pathURL];

NSGod
- 22,699
- 3
- 58
- 66