Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NSPathControl set path

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

like image 651
k4lls Avatar asked May 31 '26 07:05

k4lls


2 Answers

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


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

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

NSLog(@"%@",pathSegmentClicked);
NSLog(@"%@",pathURL);
NSURL *pathURL = [NSURL fileURLWithPath:[@"~/Desktop" stringByExpandingTildeInPath]];
[pathControl setURL:pathURL];
like image 33
NSGod Avatar answered Jun 02 '26 02:06

NSGod