I just downloaded the latest version of AFNetworking from github .
I drag the folder to my xCode iOS project, disable ARC for the AFNetworking files and compile . The compiler prompts an error, claiming that line 702 of AFHTTPClient.m has error:
HTTPClient.networkReachabilityStatusBlock = self.networkReachabilityStatusBlock;
Any advice? Did I miss something?
I found that Getting Start Guide of AFNetworking missed a critical step :
Add SystemConfiguration.framework to the project
Add the line #import <SystemConfiguration/SystemConfiguration.h> after the line #import <Foundation/Foundation.h> in Prefix.pch
Just to add to Shivan's point, I think you also need to add
1) Add MobileCoreServices/MobileCoreServices to your project
2) Add the line #import to your x.pch file
Otherwise AFNetworking will throw up warnings.
Related
I found a bug that I'm kind of stumped by. Wondering if anyone else experienced this.
I have this MBProgressHud pod that I include in my ViewController.h. Presumably I'll use it in ViewController.m somewhere.
I also want to include ViewController.h in my bridging header so that I can write a Swift extension.
However, when I build and run, I get an error:
'MBProgressHUD.h' file not found
I've recreated the error in this project: https://github.com/zackshapiro/PodTest
Any help would be appreciated
Replace
#import "MBProgressHUD.h"
with
#import <MBProgressHUD/MBProgressHUD.h>
And all will be compiled. MBProgressHUD.h is a file from module MBProgressHUD therefore you can't include it with ""
Hello guys I got this error when attempting to compile my file in swift:
I have added the frameworks: FSBDKCoreKit, FBSDKLoginKit, FBSDKShareKit, and Bolt to my root folder and not my xcodeprojectworkspace. But I'm receiving these errors. Please I need some assistance.
Also i added the frameworks in DealsApp-Bridging-Header:
I had the same problem some days ago. Couldn't find why but when I tried to install the sdk with cocoa pods instead of just dragging the files it just worked.
Give this a try: https://edbinx.com/apple/ios/use-facebook-fbsdk-swift-cocoapods-ios-9-13369.html
From Errors, I think you need to add
#import <FBSDKCoreKit/FBSDKCoreKit.h>
#import <FBSDKLoginKit/FBSDKLoginKit.h>
in your file "DealsApp-Bridging-Header.h"
QUESTION: What and where is the pre-compiled header file in an xcode project?
PROBLEM: I need help with xcode.
DISCLAIMER: I know nothing about xcode.
BACKSTORY: I have an app built with appcelerator, which builds an xcode project for me. Now I want to make it Citrix Ready which by this press release should be easy http://www.appcelerator.com/press-releases/citrix/ but < rant > they have no documentation on this, no one at appcelerator seems to care, and they say to use SO for support (which I did and it got me the peer pressure badge, yay!).< /rant >
So, since they suck I'm trying to do it myself directly in xcode and with a question that is acceptable within SO guidelines.
SITUATION: I'm up to step 3 of the steps to do this are listed on the Citrix website: http://docs.citrix.com/en-us/mdx-toolkit/10/xmob-mdx-dev-guide-overview/xmob-mdx-dev-ios-apps.html#par_anchortitle_33e5
Step 3: Revise a line of code in the pre-compiled header file in the app project to import WorxEnable.h from Worx.framework as shown in the following example
#ifdef__OBJC__
_
//import MDX extensions
#import <AVFoundation/AVFoundation.h>
#import <SystemConfiguration/SCNetworkReachability.h>
#import <Worx/WorxEnable.h>
#endif
I just don't know what or where the pre-compiled header file is.
Any help would be much appreciated.
I look forward to posting questions about steps 4 and 5 asking what those mean and how to do them:
Step 4: Add the following to “other linker flags” if they do not already appear:
Step 5: Add the following frameworks and libraries:
Thanks!
Hum, I think it's the .pch file.
If it not exist in your Xcode project (Xcode does not create automatically this file now), create one like myproject-Prefix.pch (just an example).
And in the build settings, add your file path in Prefix Header
My pch file :
#import <Availability.h>
#ifndef __IPHONE_4_0
#warning "This project uses features only available in iOS SDK 4.0 and later."
#endif
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#import <MobileCoreServices/MobileCoreServices.h>
#import <SystemConfiguration/SystemConfiguration.h>
#endif
I added a bridge header to my app the other day because I was trying to add Objective-C files to my Swift project. I was having trouble getting the connection to work(and I also did not know how to implement the Objective-C files), so I decided I wanted to start over again. I deleted the Objective-C files and the Bridge-Header file and now I am getting an error saying:
<unknown>:0: error: bridging header '/Users/CalebKleveter/Documents/Development/iOS/personal/swift/Projects/Dicey/Dicey/Dicey-Bridging-Header.h' does not exist
Go to Build Settings of your project, find Objective-C Bridging Header row and remove its contents.
Go to targets file->Build Settings->Swift Compiler - General, delete the contents in the same line as Objective-C Bridging Header
Since removing the bridging header or even just leaving it without any content often causes build errors, the quick workaround I've found is leaving the header with nothing but the following two imports:
#ifndef BridgeHeader_h
#define BridgeHeader_h
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#endif
Deleting the lines containing SWIFT_OBJC_BRIDGING_HEADER in MyProjectName.xcodeproj/project.pbxproj did the trick for me.
I could not find the Build Settings in my Xcode project as other answers mentioned (maybe because my project is for MacOS, not iOS?).
I have a iOS Swift Project on Xcode.
I've been working on it for a long while using external Objective-C libraries on my Swift code with no problem.
Suddenly, after Xcode got updated (I guess), I try to run my project and apparently it's trying to compile de external Objective-C as Swift, so, of course, it fails.
I attach an screenshot with the errors:
And this is my Bridging Header:
#define degreesToRadian(x) (M_PI * (x) / 180.0)
#import <Parse/Parse.h>
#import <FBSDKCoreKit/FBSDKCoreKit.h>
#import <FBSDKLoginKit/FBSDKLoginKit.h>
#import <Bolts/Bolts.h>
//#import <Facebook-iOS-SDK/FacebookSDK/FacebookSDK.h>
#import <ParseFacebookUtils/PFFacebookUtils.h>
#import <Bugsnag.h>
#import <M13Checkbox.h>
#ifndef VideoCloudBasicPlayer_VideoCloudBasicPlayer_Bridging_Header_h
#define VideoCloudBasicPlayer_VideoCloudBasicPlayer_Bridging_Header_h
#import "BCOVPlayerSDK.h"
#endif
Any ideas?
Hmm.. I had the same issue before.
After trying to clean and remove derived data, I fixed it by removing the old obj-c libraries and re-adding them to my project. There may be a setting in target to tell the ARC to read objective c, but I never found it.
My Obj-c libraries somehow lost their target membership and thought it was swift.
Commit your changes. Save your bridging header and remove the library and re-add the library, File - New - Target - (make sure Obj-C is set as language), then add your class files to the directory. It should compile...
It didn't work before due to I'm using Parse as my first Cocoapod dependency. So I erased it from my Podfile and installed it by drag and drop style.
Then, just after that my final solution to my issue when working with Cocoapods dependencies was to delete everything (except Parse), update the Cocoapods to the latest version, reinstall everything (while Xcode is closed).
PD:
The solution above works perfectly when using Drag-and-drop installed libraries.