Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/26.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c setTitleWithRepresentedFilename不更改NSWindows文件名?_Objective C_Cocoa_Nswindow_Nsdocument - Fatal编程技术网

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一起使用可能不会返回文件名,这反过来也不会更改窗口的标题