重命名iOS中的类 [英] renaming classes in iOS

查看:119
本文介绍了重命名iOS中的类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Xcode 4.3.2,我想重命名我的类,所以我使用了 refactor>重命名,但此后我改变了主意,决定返回旧名称.但是当我再次做同样的事情时,会出现一个警告对话框,显示:

I am working on Xcode 4.3.2 i wanted to rename my classes so i used refactor>rename, but after that i changed my mind and decided to go back to the older name. But when i do the same thing i've done before again, a warning dialog appears saying:

yourclass.h不在此工作空间中任何目标的构建阶段中,因此无法进行重构.将文件添加到此工作空间中目标的构建阶段,或在另一个文件中进行选择.

什么是构建阶段?我该如何解决这个问题?

what's the build phase? how can i solve this problem?

非常感谢

推荐答案

在Xcode中,在左侧文件树的顶部选择您的项目.

In Xcode, select your project at the top of the file tree on the left hand side.

从此处选择目标,然后单击构建阶段"选项卡.确保要重命名的类的.m文件在编译源"下列出

From there, select your target, and click the "Build Phases" tab. Make sure the .m file of the class you're wanting to rename is listed under "Compile Sources"

这篇关于重命名iOS中的类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆