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