afnetworking

AFNetworking error too many http redirects iOS 9

不羁的心 提交于 2021-02-11 06:43:35
问题 Since today I've got some serious problems with AFNetworking requesting an https link where I want to get back some XML-Info, yesterday it already worked and I also sent out some TestFlight-Links, so it's very frustrating. I also didn't do any changes to the server configuration. But today I'm just getting the error -1007 "too many http redirects". Did someone also had a problem like this? I already saw a post of iOS 9: "too many HTTP redirects" while using Alamofire Upload Multipart Form

How to use AFNetworking 2 with Digest Authentication

旧巷老猫 提交于 2021-02-07 14:40:56
问题 I've been searching for "AFNetworking 2 with Digest Authentication" for a while and haven't found useful discussions about it (except this one, but unfortunately it looks like it's for AFNetworking 1). Here's my code without authentication: NSString* apiURL = @"https://api.example.com/WS.asmx"; AFHTTPSessionManager* manager = [AFHTTPSessionManager manager]; manager.requestSerializer = [AFJSONRequestSerializer serializer]; [manager GET:apiURL parameters: [NSDictionary

How to use AFNetworking 2 with Digest Authentication

北城余情 提交于 2021-02-07 14:40:41
问题 I've been searching for "AFNetworking 2 with Digest Authentication" for a while and haven't found useful discussions about it (except this one, but unfortunately it looks like it's for AFNetworking 1). Here's my code without authentication: NSString* apiURL = @"https://api.example.com/WS.asmx"; AFHTTPSessionManager* manager = [AFHTTPSessionManager manager]; manager.requestSerializer = [AFJSONRequestSerializer serializer]; [manager GET:apiURL parameters: [NSDictionary

【AFNetworking 分析】POST 上传多表单类型数据

孤街浪徒 提交于 2021-02-06 20:34:21
[TOC] Pre AFNetworking分析版本:4.0.1 调试所用代码(AFNetworking demo iOS) XCTestExpectation *expectation = [self expectationWithDescription:@"Request should succeed"]; [self.sessionManager.requestSerializer setValue:@"default value" forHTTPHeaderField:@"field"]; [self.sessionManager POST:@"post" parameters:@{@"key":@"value"} headers:@{@"field":@"value"} constructingBodyWithBlock:^(id<AFMultipartFormData> _Nonnull formData) { [formData appendPartWithFileData:[@"Data" dataUsingEncoding:NSUTF8StringEncoding] name:@"DataName" fileName:@"DataFileName" mimeType:@"data"]; } progress:nil success:^

CocoaPods 遇到 A host target is a "parent" target which embeds a "child" target...

僤鯓⒐⒋嵵緔 提交于 2021-01-09 11:12:32
正在开发的项目中,集成RN,在使用cocoapods 时候,pod install 遇到如下问题: [!] Unable to find host target(s) for ****Extension. Please add the host targets for the embedded targets to the Podfile. Certain kinds of targets require a host target. A host target is a "parent" target which embeds a "child" target. These are example types of targets that need a host target: - Framework - App Extension - Watch OS 1 Extension - Messages Extension (except when used with a Messages Application) 发现:pod --version 1.5.3 解决:降低一个版本试下: 直接执行:pod _1.1.1_ install 结果:OK (注意:其实可能会引起另外的问题,最好是解决本质问题,参考: 'config.h' file not found 解决过程 ) 补充

Swift NWListener listen, cancel, and relisten successfully?

此生再无相见时 提交于 2021-01-02 07:07:49
问题 I have an app where I an supposed to have a websocket that listens only when the app is in the foreground I have tapped into the lifecycle notifications and call start() and stop accordingly. The app works correctly until the appication comes back to the foreground, at which point I get a number of warnings and errors. class SwiftWebSocketServer { let port: NWEndpoint.Port var listener: NWListener? var listenerState: NWListener.State let eventHandler:()->Void var connection: ServerConnection?

OC与swift混编

烂漫一生 提交于 2020-12-24 07:42:24
1.第三方库的使用 1、第三方库是swift库,导入到swift项目。 用到的文件中需要:import Alamofire 2、第三方库是swift库,导入到OC项目。 不考虑 3、第三方库是OC库,导入到swift项目。 用到的文件中需要:import AFNetworking 4、第三方库是OC库,导入到OC项目。 用到的文件中需要:#import "AFNetworking.h" 但是在swift使用OC第三方时用Pod引入时曾遇见过一个问题,报错找不到该文件。 一般网上的步骤都是: 1,创建桥接文件, 2,配置文件路径 但是编译时报错: 出现问题的原因是podfile文件中少了一句:use_frameworks! 完整的代码为: target 'DaiChaoHeZi' do # Comment the next line if you're not using Swift and don't want to use dynamic frameworks use_frameworks! # Pods for DaichaoSwift pod 'SAMKeychain', '~> 1.5.3' pod 'BMKLocationKit' pod 'MJRefresh' end 参考链接:https://blog.csdn.net/kangpengpeng1/article

iOS13 崩溃 Fatal Exception: NSInternalInconsistencyException

独自空忆成欢 提交于 2020-11-25 11:52:28
以下是 Firebase 的崩溃日志: Fatal Exception : NSInternalInconsistencyException Modifications to the layout engine must not be performed from a background thread after it has been accessed from the main thread.` 0 应用名称 0x100df14e4 CLSProcessRecordAllThreads + 4316009700 1 应用名称 0x100df18cc CLSProcessRecordAllThreads + 4316010700 2 应用名称 0x100de1144 CLSHandler + 4315943236 3 应用名称 0x100defae8 __CLSExceptionRecord_block_invoke + 4316003048 4 libdispatch.dylib 0x1c515c184 _dispatch_client_callout + 16 5 libdispatch.dylib 0x1c510ec44 _dispatch_lane_barrier_sync_invoke_and_complete + 56 6 应用名称 0x100def554

AFNetworking

浪子不回头ぞ 提交于 2020-11-21 01:25:06
AFNetworking是一个轻量级的iOS网络通信类库。它建立在NSURLConnection和NSOperation等类库的基础上,让很多网络通信功能的实现变得十分简单。它支持HTTP请求和基于REST的网络服务(包括GET、POST、 PUT、DELETE等)。支持ARC。 代码文档查看网站: http://afnetworking.org/Documentation/ Code4App编译测试,测试环境:Xcode 4.3, iOS 5.0。 转载:http://www.adobex.com/ios/source/details/00000458.htm 来源: oschina 链接: https://my.oschina.net/u/868244/blog/105515