草庐IT

AlamoFire

全部标签

Swift App 运行但没有按钮出现

我写了一个Swift应用程序,但在运行时只显示窗口。我看不到任何按钮。这是我的代码...我试过删除.white属性,认为它可能隐藏在一层后面。什么都没有。////ViewController.swift//BraviaRemote////CreatedbyEdGilroyon7/2/17.//Copyright©2017EdwardWilliams.Allrightsreserved.//importCocoaimportAlamofireclassViewController:NSViewController,NSTextFieldDelegate{@IBActionfuncMenu

ios - 库未加载 - Alamofire

几个小时以来,我一直被一个错误所困扰。我正在使用Alamofire构建框架并在iOS项目中对其进行测试。每当我运行该项目时,我都会收到此错误:dyld:Librarynotloaded:@rpath/Alamofire.framework/AlamofireReferencedfrom:/Users/theodorestrauss/Library/Developer/Xcode/DerivedData/TGClient-ecnnvvvxipoufihfghkpxlfccyoc/Build/Products/Debug-iphonesimulator/TGClient.framework

json - 将 json 响应转换为 Realm 对象

您好,我正在尝试将来自Web服务的json响应转换为Realm对象,并使用对象映射器将其插入Realm数据库,但返回的对象具有空值Alamofire.request(url).responseJSON{responseinletproducts=Mapper().map(JSONObject:response.result.value)print("products",products)//objectwithnullvalues}我的ProRealm类是classProRealm:Object,Mappable{dynamicvaradditives_count:String?var

ios - 使用 Alamofire 通过 Swift 从 Google 获取短 URL

我正在尝试在我的应用程序中添加短url作为用户的工具,这是来自thisanswer的不幸的是它没有用!:importAFNetworkingletgoogleShortURLKey="MYKEY"funcgetShortURLFromGoogle(longURL:String){letmanager=AFHTTPSessionManager()manager.requestSerializer=AFJSONRequestSerializer()asAFJSONRequestSerializerletparams=["longUrl":longURL]manager.POST("http

ios - Swift 如何使用 Alamofire 和 SSZipArchive 从 URL 解压缩文件

funcdownLoad(fileName:String){leturlString:String="\(myurl)\(fileName)"varlocalPath:NSURL?letdestination=DownloadRequest.suggestedDownloadDestination(for:.documentDirectory)Alamofire.download(urlString,method:.get,encoding:JSONEncoding.default,to:destination).downloadProgress(queue:DispatchQueue

php - Alamofire 和 PHP 上传图片

我正在尝试上传从iPhone图库中选择的图像,我可以发送请求,但图像永远不会进入我的网络服务器。我不知道问题是在请求上还是在我的php脚本上。这个swift代码:funcenviarImg(){letimageParamName="image"letparameters=["chave":"valor"]Alamofire.upload(multipartFormData:{multipartFormDatain//importimagetorequestforimageDatainself.imagens{letdata=UIImageJPEGRepresentation(image

ios - 具有Alamofire下载功能的JWT认证

感谢Alamofire,我正在尝试下载一个zip文件并使用JWTtoken身份验证从服务器保存它.下载在没有token身份验证的情况下运行良好,文件已成功保存。当我激活服务器端身份验证(使用Passport.js和NodeJS)时,我总是收到401。我使用sessionManager适配器函数将token附加到header。其他请求(发布,使用sessionManager.request(..)获取)与此身份验证机制配合良好。问题是:能否修改Alamofire下载函数的header?如果是怎么办?感谢任何建议funcgetZip(){letsessionManager=Alamofir

ios - swift 对象映射器 : How to parse array inside of an array

这是我的JSON响应:[[{"id":22,"request_id":"rqst5c12fc9e856ae1.06631647","business_name":"CodeViable","business_email":"code@viable.com","title":"ApacheLoad/Ubuntu",}],[{"id":24,"request_id":"rqst5c130cae6f7609.41056231","business_name":"CodeViable","business_email":"code@viable.com","title":"Load",}]]这

json - swift 对象映射器 : How to parse JSON with backslash

我已经在stackoverflow上尝试了几乎所有可能的解决方案,但到目前为止没有成功,这是我的json响应:["{\"id\":5,\"request_id\":\"rqst5c17fc752d44f1.15452158\",\"business_name\":\"611Solutions\",\"business_email\":\"611thesolutions@gmail.com\",\"title\":\"123ABC-TESTING\",\"details\":\"Packageisfragile,pleasehaulwithcare\",\"load_descriptio

ios - 无法在 Playgrounds 中使用 Alamofire 查找符号错误

我正在使用Playgrounds并通过Podfile安装了Alamofire和SwiftSoup。我可以使用URLSession从URL中检索HTML,但希望使用Alamofire这样做。我的代码如下。leturl="https://www.nba.com/warriors/stats"Alamofire.request(url,method:.post,parameters:nil,encoding:URLEncoding.default).validate(contentType:["application/x-www-form-urlencoded"]).response{(re