开发者

Cocoa renaming MyDocument window title

开发者 https://www.devze.com 2023-01-02 13:43 出处:网络
How can I change the title of a window in a document based cocoa开发者_如何学运维 application? I get an error when I try the following code in MyDocument.m

How can I change the title of a window in a document based cocoa开发者_如何学运维 application? I get an error when I try the following code in MyDocument.m

- (void)awakeFromNib
{
    [self setTitle:@"Document 1"];
}


Override displayName and return the value you want displayed.

- (NSString *)displayName {
    return @"Document 1";
}

If you're subclassing NSWindowController then override windowTitleForDocumentDisplayName: instead.

0

精彩评论

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