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]