Objective c setTitleWithRepresentedFilename不更改NSWindows文件名?
我有一份我要打电话给的文件:Objective c setTitleWithRepresentedFilename不更改NSWindows文件名?,objective-c,cocoa,nswindow,nsdocument,Objective C,Cocoa,Nswindow,Nsdocument,我有一份我要打电话给的文件: [self.windowForSheet setTitleWithRepresentedFilename: @"hello"]; 打开,但windows标题不会更改。它显示MyApp-未命名1。我也尝试过: [self.windowForSheet setTitleWithRepresentedFilename: @"hello"]; [self.windowForSheet display]; 但它仍然没有得到更新 我已确认self.windowForShee
[self.windowForSheet setTitleWithRepresentedFilename: @"hello"];
打开,但windows标题不会更改。它显示MyApp-未命名1。我也尝试过:
[self.windowForSheet setTitleWithRepresentedFilename: @"hello"];
[self.windowForSheet display];
但它仍然没有得到更新
我已确认self.windowForSheet不是零。我做得不对吗?请注意,我希望标题的“Untitled 1”部分会更改。使用文件路径,而不是任意文本字符串;我想你可能在找我
如果@hello不是文件的实际路径,那么将其与setTitleWithRepresentedFilename一起使用可能不会返回文件名,这反过来也不会更改窗口的标题