My project is a doc based application. I'd like to us开发者_JAVA百科e an NSPathControl
object to display the path of the opened document at startup.
I'd insert the code here:
- (void)windowControllerDidLoadNib:(NSWindowController *)windowController
Can someone point me to an example?
Assuming you have an outlet to the path control and you are calling this from your NSDocument subclass, you can just do this:
[pathControl setURL:[self fileURL]];
If you are calling this from your NSWindowController subclass then of course it would look like this:
[pathControl setURL:[[self document] fileURL]];
There are three examples listed in the documentation for NSPathControl
Could you be more specific about the problem you're having?
精彩评论