开发者

Display Opened Document's Path at Startup in NSPathControl object

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?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜