开发者

Cocoa renaming MyDocument window title

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜