日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

关于application title一直是untitled的问题

發布時間:2023/12/10 31 豆豆
生活随笔 收集整理的這篇文章主要介紹了 关于application title一直是untitled的问题 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
建立了一個cocoa?application項目,在Interface Builder中修改了title,在運行時標題始終是“Untitled”。

這是我在http://stackoverflow.com/questions/4720030/cocoa-mac-application-title-says-untitled上找的解決方法。

I have created a document based?Mac?OSX application, and when I'm editing in Interface Builder, the title is correct (I filled out that portion of the inspector) but once the program runs, the application title is 'Untitled'. How can I change it? In my IB Doc Window, I have instances of Files Owner, First Responder, NSApplication, and NSWindow. There is no view?controller, is that the issue? I'm new to Cocoa..

-> It will probably change to the name of your document once you save it (or open one). – zneak Jan 18 at 3:07

-> Naming a new, unsaved document “untitled” is the correct way according to the HIG.?http://developer.apple.com/library/mac/#documentation/UserExperience/Conceptual/AppleHIGuidelines/XHIGWindows/XHIGWindows.html#//apple_ref/doc/uid/20000961-CHDHBCGE?Why do you want to violate that convention? – Peter Hosey Jan 18 at 5:17

下面是比較暫時比較好的解決方法:覆蓋NSDocument的-displayName方法

One solution is to override -displayName in your NSDocument subclass:

- (NSString *)displayName {
????if (![self fileURL])
????????return @"Some custom untitled string";

????return [super displayName];
}


You can also check out NSWindowController's -windowTitleForDocumentDisplayName: if you're using custom window controllers.

如果有好的建議,歡迎提供,多謝~

轉載于:https://www.cnblogs.com/aquariusgx/archive/2011/03/17/1986849.html

創作挑戰賽新人創作獎勵來咯,堅持創作打卡瓜分現金大獎

總結

以上是生活随笔為你收集整理的关于application title一直是untitled的问题的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。