草庐IT

paypal-subscriptions

全部标签

swift - 错误 : Cannot subscript a value of type 'X' with . ..'

错误:无法使用类型为“(safe:Int)”的索引为类型为“[CustomClass]”的值下标classCustomClass{letvalue:Stringinit(value:String){self.value=value}}extensionCollection{subscript(safe:Int)->Element?{ifsafe>count-1{returnnil}returnself[safe]}}letsteps:[CustomClass]=[]ifletstep=steps[safe:4]{//errorhere}为什么会这样? 最佳答

ios - '子字符串(来自 : )' is deprecated: Please use String slicing subscript with a ' partial range from' operator. Swift 4 错误

这个问题在这里已经有了答案:HowcanIuseStringsubstringinSwift4?'substring(to:)'isdeprecated:PleaseuseStringslicingsubscriptwitha'partialrangefrom'operator(21个答案)关闭5年前。我正在将我现有的应用程序从Swift3转换为Swift4。它给出了错误:'substring(from:)'isdeprecated:PleaseuseStringslicingsubscriptwitha'partialrangefrom'operator.和'characters'i

ios - PayPal 与 IOS swift 集成

支付成功后如何获取created_time和id?我只能得到确认“completedPayment.confirmation” 最佳答案 检查这个PayPal委托(delegate)方法funcpayPalPaymentViewController(_paymentViewController:PayPalPaymentViewController,didCompletecompletedPayment:PayPalPayment){print("PayPalPaymentSuccess!")paymentViewControlle

ios - 使用 FBSDKApplicationDelegate 时对成员 'subscript' 的引用不明确

我已经更新了swift3,我发现了很多错误。这是其中之一:Ambiguousreferencetomember'subscript'对于下一行funcapplication(_app:UIApplication,openurl:URL,options:[UIApplicationOpenURLOptionsKey:Any])->Bool{FBSDKApplicationDelegate.sharedInstance().application(app,open:url,sourceApplication:options["UIApplicationOpenURLOptionsSourc

swift - 从常量 : Ambiguous reference to member 'subscript' 获取值时出错

我正在使用enum和tuple以及枚举大小写的值。我无法从[String:String]常量中获取值。我不知道如何修复它,它必须是一个陷阱,但我不知道在哪里,因为key肯定是字符串:enumDictTypes:String{casesettingscaseoptionscaselocations}enumFileTypes:String{casejsoncasepList}funcgetCodebookUrlComponent()->String{varFileSpecs:(dictType:DictTypes,fileType:FileTypes,redownload:Bool)=(

swift - 在 Swift 中获取错误 Ambiguous reference to member 'subscript'

字典需要扩展以获取文本键值(如果存在)。执行以下代码并成功编译:extensionDictionarywhereKey:ExpressibleByStringLiteral,Value:AnyObject{funcgetValueForKeyPath(keyValue:String)->String{return((self["item_qty"]as?Dictionary)??["":""])?["text"]??""}}但是当我对方法做一些小改动时,出现错误:"Ambiguousreferencetomember'subscript'"extensionDictionarywher

ios - "Type ' 任务。在 Swift 中键入 ' has no subscript members"错误

关闭。这个问题是notreproducibleorwascausedbytypos.它目前不接受答案。这个问题是由于错别字或无法再重现的问题引起的。虽然类似的问题可能是on-topic在这里,这个问题的解决方式不太可能帮助future的读者。关闭6年前。Improvethisquestion这段代码给我一个错误;类型'task.Type'没有下标成员这是我的代码:structtask{varname="Un-Named"vardesc="Un-Described"}classTaskManager:NSObject{vartasks=task[]()funcaddTask(name:S

ios - 使用 Array 而不是 NSArray 时出现错误 "ambiguous reference to member subscript"

当我尝试访问数组类型值然后出现错误时,我在可能包含数组类型值的字典中收到类似“对成员下标的模糊引用”的错误。请检查以下代码。varoccupations=["Malcolm":"Captain","Kaylee":"Mechanic","Layme":["Engineer","Docter"]]as[String:Any]occupations["Jayne"]="PublicRelations"vararrOfLayme=occupations["Layme"]as!Array//gettingerrorhere,IfIuseNSArrayinsteadofarrayallwillw

ios - 使用 cocoapods 的 PayPal-iOS-SDK 在桥接头中抛出错误

我正在尝试使用cocoapods将Paypalsdk集成到一个swift项目中。我试过importPayPal_iOS_SDK模块,但它抛出以下错误Nosuchmodule'PayPal_iOS_SDK'与#import在桥接header编译器中无法找到header。我在桥接头中做错了什么吗? 最佳答案 我通过在UserHeaderSearchPaths中设置Pods/PayPal-iOS-SDK/**来修复它。后来我能够在桥接header中#import"PayPalMobile.h"。

ios - 错误 : Cannot subscript a value of type 'inout [Agenda]' (aka 'inout Array<Agenda>' )

我正在制作一个应用程序,当您按下一个表示紧急的按钮时,会有一个标签显示“紧急”。就在我实现与按钮的用户交互之前,我有一个数组(如下所示),其中一些对象具有urgent=true,但有些对象具有urgent=false,所以我可以从我的代码开始。MainTableViewController.swift中的数组:varcontent:[Agenda]=[Agenda(subject:"Readthisarticle",deadline:"1-2days",urgent:false),Agenda(subject:"Respondtothisemail",deadline:"ASAP",u