[_pathControlOutlet setURL: [NSURL URLWithString: [@"~/Desktop"stringByExpandingTildeInPath] ]];
NSURL *pathURL = [_pathControlOutlet URL];
NSLog(@"%@",[[_pathControlOutlet URL]path]);
NSString *pathSegmentClicked = [[_pathControlOutlet clickedPathComponentCell]title];
NSLog(@"%@",pathSegmentClicked);
NSLog(@"%@",pathURL);
NSPathControl set path
-
14-01-2022 - |
문제
I am looking for a way to set the path of an NSPathControl to be "~/Desktop".
해결책
다른 팁
NSURL *pathURL = [NSURL fileURLWithPath:[@"~/Desktop stringByExpandingTildeInPath]];
[pathControl setURL:pathURL];
제휴하지 않습니다 StackOverflow