iOS notes (2) 20141212 [installation and use of Cocoapods of Project Environment (ii) IOS8 todayextension pendant]

Source: Internet
Author: User


When you have the Today Extension project for iOS 8 in your project, perform

will not error, can also generate project workspace, but inReference header file in Today extension project
#import "AFNetworking.h" <pre name= "code" class= "OBJC" > #import "UALogger.h"

Modify the Viewdidload function as follows:

-(void) viewdidload {[Super viewdidload];        Do any additional setup after loading the view from its nib.    Afnetworkreachabilitymanager *afnetworkreachabilitymanager = [Afnetworkreachabilitymanager SharedManager];  [Afnetworkreachabilitymanager startmonitoring];                Turn on Network Monitor; [Afnetworkreachabilitymanager setreachabilitystatuschangeblock:^ (afnetworkreachabilitystatus status) { Switch (status) {case afnetworkreachabilitystatusnotreachable:{B            Reak;            } Case afnetworkreachabilitystatusreachableviawifi:{break;            } Case afnetworkreachabilitystatusreachableviawwan:{break;        } Default:break;        } ualog (@ "Network status number returned:%i", status);            Ualog (@ "Network status return:%@", Afstringfromnetworkreachabilitystatus (status)); }];}

The compilation will report an error, the prompt cannot find the file, my main project name is Testpodtoday,The Today Extension project was named News,after viewing the project configuration file DiscoveryThe news pod does not have a header file path configured, so it adds
"${pods_root}/headers/public" "${pods_root}/headers/public/afnetworking" "${pods_root}/headers/public/ Mbprogresshud "" ${pods_root}/headers/public/reactivecocoa "" ${pods_root}/headers/public/reactivecocoa/ Reactivecocoa "" ${pods_root}/headers/public/reactiveviewmodel "" ${pods_root}/headers/public/ualogger "
Go to

Okay, then compile, this is the report.

"_afstringfromnetworkreachabilitystatus", referenced from:

___34-[todayviewcontroller Viewdidload]_block_invoke in TODAYVIEWCONTROLLER.O

The Pod Lib library is not found,

Returning to the project configuration file will

-objc-l "pods-afnetworking"-L "pods-mbprogresshud"-L "Pods-reactivecocoa"-L "Pods-reactiveviewmodel"-L " Pods-ualogger "-framework" Coregraphics "-framework" mobilecoreservices "-framework" Security "-framework" SystemConfiguration "
Add the value to <other Linker flags> and click on Xcode build Phases, under <link Binary with libraries> option point + number selection
Libpods.a
Add. Then compile
Well, it's been compiled, and it's done.

Relevant code has been uploaded to Code.csdn

Code Portal




iOS notes (2) 20141212 [installation and use of Cocoapods of Project Environment (ii) IOS8 todayextension pendant]

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.