xcode 重命名/重构视图控制器

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11249278/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 00:43:30  来源:igfitidea点击:

Renaming/refactoring a View Controller

iosxcodexcode4.3

提问by sayguh

I used this tutorial to rename a view controller http://iosdeveloperzone.com/2011/05/14/how-to-rename-a-class-using-refactoring-in-xcode-4/

我使用本教程重命名视图控制器 http://iosdeveloperzone.com/2011/05/14/how-to-rename-a-class-using-refactoring-in-xcode-4/

Basically just switch to Symbol Navigator view click on the view controller and then Edit > Refactor > Rename

基本上只需切换到 Symbol Navigator 视图,点击视图控制器,然后编辑 > 重构 > 重命名

Worked great!

工作得很好!

However, when I go to symbol navigator now, my newly named view controller doesn't show there anymore?

但是,当我现在转到符号导航器时,我新命名的视图控制器不再显示在那里?

Why did it disappear? What if I want to rename it again?

为什么消失了?如果我想再次重命名怎么办?

Thanks!

谢谢!

采纳答案by Dustin

Use File >> Add files to "project name" and select your viewcontroller file. If your program doesn't have the files explicitly in its directory of files to load, it tends to ignore them.

使用文件>>将文件添加到“项目名称”并选择您的视图控制器文件。如果您的程序在其要加载的文件目录中没有明确的文件,它往往会忽略它们。