iOS Development-Project renaming (graphic)

Source: Internet
Author: User

PS: Canvassing ~

I participated in the 2014 Blog Star Contest, please help cast the vote
Http://vote.blog.csdn.net/blogstar2014/details?username=hitwhylz#content



Foreword: In iOS development, sometimes want to change the name of the project, will encounter a lot of trouble. Change the project name directly, and Xcode won't help you change all your names. There are always many files, folders, or items that are set by the project. And they are not easy to change, and sometimes change to change, can not compile. So when you rename the project, remember to back up a copy of it first. This article I will introduce a method, I have consulted a lot of information to draw a summary.

Why is that complete? Because after renaming, you will not see any more about the previous project name.

This article will change a project called "test233333333" to "test".

1) Open the project:

The above is the current project structure.

2) Select the project settings and press ENTER to enter the new project name:

3) After entering, press ENTER, pop-up before renaming and renaming the file name, then click "Rename":

4) Then a dialog box will pop up and click "Enable" directly:

5) At this point you will find that there are many "old" project names in the File/folder:

It doesn't matter, keep looking down and get rid of these "old" names together.

6) Let's change the names of the two folders first:

Before change:

After the change:

The testtests here, originally for test233333333tests, we need to change the name of the attention, just need to replace the old name (test233333333) replaced by the new name (test), do not remove the other characters (Tests)!

7) Select this class file, change the class name cannot be renamed directly, need to use Xcode built-in Change class name feature:

Click the class name after @interface:

Follow the steps (Edit->refactor->rename):

Enter a new class name:

Click Save:

8) Once again we look at our directory structure, which has all been changed, but now the compilation will not pass:

9) We tried to build,Xcode reported such an error, unable to find the connection file:

This is because there are a lot of items to change the name of the project, now Xcode is still pointing to the previous project name.

10) Search for the previous item name and replace it with the new item name:

Note: Just replace the comment here, the real project setup requires us to do it manually.

11) Global Search for the old item name comes out of the interface, we click in to change the name:

Click to automatically jump to this interface, double-click the value of the change (the following steps to rename the same):

After the changes, you have to change something. Don't ask why it's so troublesome, just because of caprice.

Note: Continue the global search substitution until the old name is not found in the global search!

12) Open the project folder and continue renaming:

After renaming:

Back to the project to see, the file is full of "red". It doesn't matter, it's normal:

13) Change the resource folder path of the relative folder:

13.1) Check the Test folder:

13.2. Click the Small folder icon to change the path:

Find the file that you just changed your name, and click Choose. The next folder (testtests) step repeats above.

After you've changed it, build again, and you're through.

Results after the project is fully renamed:

Project structure:

Project REAL directory structure:

Summary: Do not change the project's friends, remember to back up before the first good OH.


Reference Link: Garveycalvin

iOS Development-Project renaming (graphic)

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.