문제

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

도움이 되었습니까?

해결책

[_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];
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top