草庐IT

PARAMETER

全部标签

java - 将 Kotlin 数据对象映射到数据对象的更好方法

我想将一些“数据”类对象转换/映射为类似的“数据”类对象。例如,Web表单类到数据库记录类。dataclassPersonForm(valfirstName:String,vallastName:String,valage:Int,//maybemanyfieldsexistherelikeaddress,cardnumber,etc.valtel:String)//mapsto...dataclassPersonRecord(valname:String,//"${firstName}${lastName}"valage:Int,//copyofage//maybemanyfield

java - 将 Kotlin 数据对象映射到数据对象的更好方法

我想将一些“数据”类对象转换/映射为类似的“数据”类对象。例如,Web表单类到数据库记录类。dataclassPersonForm(valfirstName:String,vallastName:String,valage:Int,//maybemanyfieldsexistherelikeaddress,cardnumber,etc.valtel:String)//mapsto...dataclassPersonRecord(valname:String,//"${firstName}${lastName}"valage:Int,//copyofage//maybemanyfield

ios - NSInternalInconsistencyException : 'Invalid parameter not satisfying: !stayUp || CLClientIsBackgroundable(internal->fClient)'

我试图让我的应用程序在Xcode7beta中运行,但我遇到了这个异常:NSInternalInconsistencyException:'Invalidparameternotsatisfying:!stayUp||CLClientIsBackgroundable(internal->fClient)'这是调用堆栈:0CoreFoundation0x00000001063a89b5__exceptionPreprocess+1651libobjc.A.dylib0x0000000105e20debobjc_exception_throw+482CoreFoundation0x00000

ios - CGBitmapContextCreate : unsupported parameter combination

我正在尝试创建一个8位灰度上下文,如下所示:CGColorSpaceRefcolorSpace=CGColorSpaceCreateDeviceGray();CGContextRefcontext=CGBitmapContextCreate(data,m_width,m_height,8,m_width,colorSpace,kCGBitmapByteOrder32Little|kCGImageAlphaNone);但是我有以下错误:CGBitmapContextCreate:unsupportedparametercombination:8integerbits/component;

ios - Firebase 身份验证错误 : 'data parameter is nil' calling getIDTokenForcingRefresh

我正在使用适用于iOS的FirebaseUI通过google或facebook登录我的应用。我刚刚将pod更新到这个版本:InstallingFBSDKCoreKit4.31.1(was4.31.0)InstallingFBSDKLoginKit4.31.1(was4.31.0)InstallingFabric1.7.6(was1.7.5)InstallingFirebase4.12.0(was4.9.0)InstallingFirebaseAnalytics4.1.0(was4.0.9)InstallingFirebaseAuth4.6.0(was4.4.3)InstallingFi

ios - 在 Swift 中初始化结构错误 : Generic parameter could not be inferred

我试图在不提供参数的情况下在类中声明一个结构。该结构将需要由函数初始化,但应该对整个类可见。通常,我可以执行varmyStruct:MyStruct?但这次它给我一个错误。无法推断通用参数“Type”我是否错误地初始化了结构?我是如何使用它的:classMyClass:{staticletsharedInstance=MyClass()privateoverrideinit(){}letmyStruct=MyStruct?//?//?()//?'withnoargumentsfuncrunFunction(A:Int,B:Int){myStruct(var1:A,var2:B)//我的

objective-c - Swift 中的 block 显示错误 "Missing argument for parameter #2 in call"

关闭。这个问题是notreproducibleorwascausedbytypos.它目前不接受答案。这个问题是由于错别字或无法再重现的问题引起的。虽然类似的问题可能是on-topic在这里,这个问题的解决方式不太可能帮助future的读者。关闭7年前。Improvethisquestion我现在正在使用JonasGessner的JGActionSheet在我的项目中使用Swift,示例是由Objective-C编写的,当我尝试将block转换为Swift时,Xcode显示错误“调用中参数#2缺少参数”,这是我编写的代码和屏幕截图:Objective-C示例JGActionSheet*

ios - 错误 : generic parameter 'T' could not be inferred in swift

我有一个函数,可以从嵌套数组中生成扁平数组。它非常适合int数组。letarray:[Any]=[1,2,[3]]funcmakeFlatArray(_array:[Any])->[Int]{varflatArray=[Int]()foriteminarray{ifletitem=itemas?Int{flatArray.append(item)}elseifletitem=itemas?[Any]{letresult=makeFlatArray(item)flatArray+=result}}returnflatArray}但我想让它成为通用的,但我在尝试时遇到了错误。funcmak

swift 错误 : Generic parameter 'T' is not used in function signature

我正在尝试使用泛型来简化一些XML反序列化,但是,Swift2.0令人窒息地说我没有在我的方法签名中使用泛型。我很困惑为什么它会抛出这个错误,因为我直接实例化了传入的类类型。关于这个错误的原因有什么建议吗?确切的错误是:Genericparameter'T'isnotusedinfunctionsignatureMTXMLDeserializable是我正在使用的基类,它的方法是:init(properties:Dictionary?,propertyMap:Dictionary?)这是有问题的方法:functransformResponse(responseData:XMLIndex

ios - 错误 : UICollectionView must be initialized with a non-nil layout parameter

我正在尝试从youtube教程创建一个类似FacebookMessenger的应用程序。我有一个主页,用户可以在其中单击BarButton打开聊天。主页工作正常,直到我单击BarButton打开聊天,它崩溃并显示以下错误消息“必须使用非零布局参数初始化UICollectionView”。我是iOS开发的新手,所以无法真正理解问题出在哪里,因为我已经有了init方法。由于我有不同的观点,我是否在AppDelegate中遗漏了什么,这令人困惑:(。非常感谢您的帮助。谢谢!classChatViewController:UICollectionViewController,UICollect