Pod-managed iOS project modify project name

Source: Internet
Author: User

Disclaimer: Most of this article comes from the following URLs, and the rest is a summary and complement of your own attempts.

HTTP://WWW.JIANSHU.COM/P/5F088ACECF64 Full revision of IOS project name 1

http://www.cnblogs.com/GarveyCalvin/p/4195745.html Full revision of iOS project name 2

http://blog.csdn.net/freedom2028/article/details/10244819 removing pods from iOS project

http://blog.csdn.net/xiaonaiping061/article/details/48465159 iOS project with pod modification project name one. First look at modifying the iOS project name:

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.

first, look at modifying the iOS 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.

This is the end of the project without pods, but the pod-containing project has to remove the pod.

Second, the project containing pod

1. Delete the Podfile, Podfile.lock, and Pods folders under the project folder

2. Delete the Xcworkspace file

3. Use the Xcodeproj file to open the project, delete the Pods.xcconfig and LIBPODS.A references under the frameworks group

4. Delete the check Pods manifest.lock and copy Pods Resources under build phases in the project setup

PS: If the cocoapods is integrated into the project after accidentally modifying or deleting its related files can not be passed for example: accidentally

Pods.xcconfig was removed and then the diff:/... /podfile.lock:no such file or directory, after removing Cocoapods with the method above,

And then re-$sudo pod install a bit better.

If a permissions issue occurs when compiling, $sudo chmod 777 to the project folder path-to-project-folder/*

$sudo Chown 777 path-to-project-folder/*

Can.

Attention:

There are two issues that may occur:

1. Removing pod and then reinstalling causes the old configuration file to exist in the project, so pod install fails.

WORKAROUND: Set the configuration in to none,

2, the change of name led to the appearance of the old project. A file cannot be connected to.

WORKAROUND: You need to delete the corresponding. A in the OK.

Pod-managed iOS project modify project name

Related Article

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.