Failed to load Info.plist from bundle
I had tried all suggestion and none of them work Then I tried to Reset content and Setting of simulator and it worked for me. 🙂
I had tried all suggestion and none of them work Then I tried to Reset content and Setting of simulator and it worked for me. 🙂
There’s a sweet little pod for this: https://github.com/konkab/AlamofireNetworkActivityLogger Add this to your podfile: pod ‘AlamofireNetworkActivityLogger’, ‘~> 2.0′ In your AppDelegate: import AlamofireNetworkActivityLogger Then in your didFinishLaunchingWithOptions, add this: NetworkActivityLogger.shared.level = .debug NetworkActivityLogger.shared.startLogging() EDIT: I’ve actually encountered crashes with this in production. To be on the safe side, use “build flags” to only use this in … Read more
If your problem is still not resolved by the answer given here. I believe one of your objects inside the parameters might not be an instance of NSString, NSNumber, NSArray, NSDictionary, or NSNull. As given in the documentation for JSONSerialization class: An object that may be converted to JSON must have the following properties: The … Read more
Great questions. Let’s break down each one individually. What is the proper usage of URLRequestConvertible in real world API? The URLRequestConvertible protocol is a lightweight way to ensure a given object can create a valid NSURLRequest. There’s not really a strict set of rules or guidelines that exist forcing you to use this protocol in … Read more
This is a really good question. Your approach is perfectly valid. However, Alamofire can actually help you streamline this even more. Your Example Code Dispatch Queue Breakdown In you example code, you are jumping between the following dispatch queues: NSURLSession dispatch queue TaskDelegate dispatch queue for validation and serializer processing Main dispatch queue for calling … Read more
2019 UPDATE If you have this error and you use ‘alamofire5’ branch just change Alamofire.request to AF.request.
This seems to be a bug in XCode. I had the same problem, and as described in the comments of another answer to this question, building the project made the error go away.
Your example Alamofire.request(.POST, “http://mywebsite.example/post-request”, parameters: [“foo”: “bar”]) already contains “foo=bar” string as its body. But if you really want string with custom format. You can do this: Alamofire.request(.POST, “http://mywebsite.example/post-request”, parameters: [:], encoding: .Custom({ (convertible, params) in var mutableRequest = convertible.URLRequest.copy() as NSMutableURLRequest mutableRequest.HTTPBody = “myBodyString”.dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false) return (mutableRequest, nil) })) Note: parameters should not … Read more
Here is a simple function that requires the target upload url, parameters, and imageData and returns the URLRequestConvertible and NSData that Alamofire.upload requires to upload an image with parameters. // this function creates the required URLRequestConvertible and NSData we need to use Alamofire.upload func urlRequestWithComponents(urlString:String, parameters:Dictionary<String, String>, imageData:NSData) -> (URLRequestConvertible, NSData) { // create url … Read more