CocoaPods Multiple use

Source: Internet
Author: User

In the previous article on the installation of Cocoapods, this article on the use of cocoapods and encountered some problems of the solution (⊙o⊙)

First, the creation of cocoapods use

1, CD into the project directory

2. Create Podfile file $ pod init

3. Edit Podfile file $sudo vi podfile

4, Import framework $ Pod ' frame name ' can specify version number $ Pod ' frame name ', ' ~> version number ', typically not specified version number, default with the nearest

5. Press ESC, then enter: Wq Save

6, add frame, $ pod install (both Xcode and emulator are turned off)

7. Open the project name. Xcworkspace This file will open the project.

8, add the header file can be used, note: Only use angle brackets to import <>

9. Framework update $ pod Update

10, third-party framework append, search frame $ pod Search, then write podfile, use pod install

Note that if you previously imported a third-party library manually, now use cocoa pods, to modify the other Linker Flags, add $ (inherited)

Ii. problems that may be encountered

(1) Using Cocoapods to import a third-party class library does not have code hints?

Workaround: Select Target, Build Settings menu, find \ "User Header Search paths\" setting entry, add a value of "${srcroot}" and select \ "Recursive\"

(2) The following warning appears

[!] Your Podfile has had smart quotessanitised. To avoid issues on the future, you should not use TextEdit forediting it. If you is not using the TextEdit, you should turn off smart quotes Inyour editor of choice.

Workaround: Do not use text editing to edit podfile, use Xcode to edit, or use the terminal to tap commands to edit.

(3) After the pod install or pod Update command is executed, updating local specsrepositories is stuck

Workaround: Pod Install is wall, replace with new command pod install--verbose--no-repo-update

CocoaPods Multiple use

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.