iOS Open source Class Library tool cocoapods usage Considerations-Error resolution

Source: Internet
Author: User

When using Cocoapods, if we do not use it correctly, there will be some problems or errors.

How to solve? This article describes:

1. Add a framework to the project, which explains how to install and simply use the afnetworking framework in the previous article

But now I want to add some other frameworks, like Mbprogresshud, how do I do that?

First, go to the project root directory and look for Mbprogresshud ...

Execute command:

Pod Search Mbpro

Will search for a matching frame:

Mbprogresshud (0.9.1) An   IOS activity indicator view.   Pod ' Mbprogresshud ', ' ~> 0.9.1 '   -homepage:http://www.bukovinski.com   -Source:   https://github.com/ Matej/mbprogresshud.git   -versions:0.9.1, 0.9, 0.8, 0.7, 0.6, 0.5 [master repo]-> mbprogresshudextensions (0.0.1)   Uiviewcontroller extensions for displaying an mbprogresshud   pod ' mbprogresshudextensions ', ' ~> 0.0.1 '   -Homepage:https://github.com/symmetricinfinity/mbprogresshudextensions   -Source:   https://github.com/ Symmetricinfinity/mbprogresshudextensions.git   -versions:0.0.1 [master repo]

We copy,

Pod ' Mbprogresshud ', ' ~> 0.9.1 '


Append to Podfile:

As follows

# Uncomment this line to define a global platform for your project# Platform:ios, ' 6.0 ' target ' Firstapp ' Dopod ' afnetwork ing ', ' ~> 2.5.1 ' pod ' mbprogresshud ', ' ~> 0.9.1 ' endtarget ' firstapptests ' doend

Execute command:

Pod Update

(You can also use the Pod Install command)

You can add a frame Mbprogresshud

Use the method to import the framework

#import <AFNetworking.h>

#import <MBProgressHUD.h>

2. Different computer cocoa version, compile and run, there may be problems, we need to update Cocoapods to the latest version

How do I update it?

Perform the following commands, which can be updated to view version information

sudo gem update--systemsudo gem install cocoapodspod setuppod--version
3. Recommend the use of Cocoapods, (copy the source code can be

)

According to the method described earlier, after installation, after the afnetworking framework, will again pods static engineering production of the corresponding folder, we directly use an empty test project to install all the required framework, then all the framework is up to date, we copy these folders to our project ( This project does not use the Cocoapods Installation class library)

After copying the contents of the folder to the project, we can use these files as our own source files, so that there will be no problem in different versions or machines.

When you have a new version of the class library, re-copy it again


When used, direct import can

#import "AFNetwoking.h"

4. If there are updates or errors, first use Pod update to update the class library, or pod install (or use method 3/2)

5. After opening the project there is an error, please check whether it is open is the correct project

6. If you encounter an open source class library such as zxing or zbar QR code static Library. A file can not be used, the use of cocoapods installation Zbar frameworks such as the source code to re-compile the source can solve the problem


Original: Http://blog.csdn.net/yangbingbinga

iOS Open source Class Library tool cocoapods usage Considerations-Error resolution

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.