我的应用程序中有一个NSPathControl供用户选择硬盘上的文件。
我想用
-(IBAction) clickedPath:(id) sender { NSString *string=[[NSString alloc] initWithFormat:[[pathControl clickedPathComponentCell] stringValue]]; NSLog (@"%@", string); }
提前谢谢!
尝试使用URL属性:
- NSString *string=[[pathControl URL] path];