草庐IT

before_request

全部标签

swift - Alamofire:类型 'Request' 的值没有成员 responseImage?

我正在做一个项目,使用Alamofire+AlamofireImage。我刚刚通过CocoaPods安装了AlamofireImage,但出现了这个错误:Valueoftype'Request'hasnomember'responseImage'对于行:Alamofire.request(.GET,locationURL).responseImage{responseinifletimage=response.result.value{//morecode在所有其他项目中工作正常,Podfile安装行也完全相同。 最佳答案 不确定整

ios - Swift3 Collection View 'attempt to delete item 1 from section 1, but there are only 1 sections before the update'

我的应用程序因“尝试从第1部分删除第1项,但更新前只有1个部分”而崩溃我发现其他文章说数据源必须与collectionView或tableView保持同步,所以我从我的数组中删除了对象:删除我的collectionView中的项目之前的警报,这适用于didSelectItemAtIndexPath。但我不知道为什么这不起作用。我还尝试打印array.count,它显示对象确实从数组中删除了。funcdisableAlarmAfterReceiving(notification:UILocalNotification){foralarminalarms{ifalarm==notifica

ios - Alamofire 4.0.0 : [String:String] is not convertible to [String : Any] & Request is ambiguous without more context

我正在将Alamofire更新到4.0.0Beta1并将XCode8更新到Beta6。首先,我得到了[String:String]isnotconvertibleto[String:Any]错误代码letparameter=["scope":"\(scope)","client":"\(clientId)"]Alamofire.request(link,withMethod:.POST,parameters:parameter,encoding:.json).responseJSON在我更改后将[String:Any]添加到参数中,错误消失但产生了新错误:Expressiontype'

ios - Xcode 9.1 警告 "Language directional layout margins before iOS 11.0"

我注意到Xcode警告说:"LanguagedirectionallayoutmarginsbeforeiOS11.0"即使这个问题在Appledeveloperforumthead.中也没有得到解答我使用了Storyboard和警告不会导致任何特定View。是什么原因或有什么解决办法? 最佳答案 我能够找出警告的原因。在Storyboard->SizeInspector中,将LayoutMargin设置为Default。之前是LanguageDirectional。根据文档,对于ViewController的RootView,UI

ios - 错误 : Use of 'self' in property access 'texture' before super. init 初始化自身

我是swift的新手,我正在尝试通过以下方式学习swift创建一个简单的纸牌游戏。我从视频中输入了完全相同的代码。但是xcode显示错误“在super.init初始化self之前在属性访问‘texture’中使用‘self’”感谢您的帮助!importSpriteKitclassCard:SKSpriteNode{varrank:Intvarsuit:StringvarimageNameUp:StringvartextureUp:SKTexturevartextureDown:SKTextureinit(rank:Int,suit:String,faceUp:Bool){self.ra

ios - 为什么在注册子类时出现错误 "the class ... must be registered with registerSubclass before using Parse"?

从iOSparse-library-1.6.3升级到parse-library1.7.5后,我在我的一个PFQueryTableViewController的queryForTable中收到以下错误:Terminatingappduetouncaughtexception'NSInternalInconsistencyException',reason:'TheclassAppname.AttendingModelmustberegisteredwithregisterSubclassbeforeusingParse.'但是,我在application:didFinishLaunchi

ios - CCAvenue: "Error!!! in decrypting application request"

我正在尝试将CCAvenue支付网关集成到我使用swift4开发的iOS应用程序中。我得到了"Error!!!Problemindecryptingapplicationrequest"我已检查给出的答案:https://stackoverflow.com/a/37327122/3548469但我的案子没有运气。这是我从文档中尝试过的privatefuncgettingRsaKey(completion:@escaping(_success:Bool,_object:AnyObject?)->()){letserialQueue=DispatchQueue(label:"serialQ

ios - 收到 MailChimp 错误 "Your request did not include an API key.",即使使用 Alamofire 包含 API key

我正在使用Alamofire向MailChimp发送请求以将用户添加到列表MailChimp的文档说:Thereare2authenticationmethodsfortheAPI:HTTPBasicauthenticationandOAuth2.TheeasiestwaytoauthenticateisusingHTTPBasicauthentication.EnteranystringasyourusernameandsupplyyourAPIKeyasthepassword.我为Alamofire写的请求:letparams:[String:AnyObject]=["email_

swift - 错误 : Extra parameter in request i used Swift 4. 为什么我必须传递类型为 [String : Any]? 的参数

Alamofire.request(APPURL.GetAccounts,method:.post,parameters:transactionData,encoding:JSONEncoding.default,headers:nil).responseJSON{responseDatain}我的问题是限制我只能通过[String:Any]类型的字典的原因是什么?完整代码:classfuncgetAccounts(transactionData:[String:Any]?,withCompletionHandler:@escaping(_response:AnyObject?)->(

ios - Swift- 错误 : Variable 'self.___' used before being initialized

我正在尝试在Playground中使用手势识别器,但遇到了一些问题。这是我的类(class):classfoo{varfooVarSwipe:AnyvarfooVarTap:Anyinit(){letgr=UISwipeGestureRecognizer(target:self,action:#selector(foo.bar))lettr=UITapGestureRecognizer(target:self,action:#selector(foo.tar))helloApple.addGestureRecognizer(gr)helloApple.addGestureRecogni