草庐IT

constructor_arguments

全部标签

ios - 发电机 : The attempted filter operation is not supported for the provided filter argument count

我正在使用带有AmazonWebServices的iOSSDK我正在尝试使用以下代码发出扫描请求:DynamoDBScanRequest*request=[[DynamoDBScanRequestalloc]initWithTableName:self.tableName];DynamoDBCondition*condition=[[DynamoDBConditionalloc]init];[conditionsetComparisonOperator:@"GT"];NSString*key=[[alertViewtextFieldAtIndex:0]text];//ReturnsNS

constructor - Kotlin 数据类可以有多个构造函数吗?

我知道数据类就像kotlin中默认带有getter和setter的简单模型,并且很简单:dataclassUser(valname:String,valage:Int)是否可以为该数据类声明第二个构造函数? 最佳答案 Kotlin数据类必须具有定义至少一个成员的主构造函数。除此之外,您可以添加辅助构造函数,如ClassesandInheritance-SecondaryConstructors中所述。.对于您的类,以及示例辅助构造函数:dataclassUser(valname:String,valage:Int){construc

constructor - Kotlin 数据类可以有多个构造函数吗?

我知道数据类就像kotlin中默认带有getter和setter的简单模型,并且很简单:dataclassUser(valname:String,valage:Int)是否可以为该数据类声明第二个构造函数? 最佳答案 Kotlin数据类必须具有定义至少一个成员的主构造函数。除此之外,您可以添加辅助构造函数,如ClassesandInheritance-SecondaryConstructors中所述。.对于您的类,以及示例辅助构造函数:dataclassUser(valname:String,valage:Int){construc

ios - 警告 : Format specifies type 'long' but the argument has type 'UIWebViewNavigationType' ( aka 'enum UIWebViewNavigationType' )

想知道是否有人可以帮助我解决我在Xcode中收到的这个错误警告。我认为这与32v64位有关。我希望代码在32位和64位中都能工作。代码的相关部分是:-(BOOL)webView:(UIWebView*)webViewshouldStartLoadWithRequest:(NSURLRequest*)requestnavigationType:(UIWebViewNavigationType)navigationType{NSLog(@"expected:%ld,got:%ld",(long)UIWebViewNavigationTypeLinkClicked,navigationTyp

constructor - 如何在 Kotlin 中扩展具有多个构造函数的类?

我正在学习Kotlin,遇到了一个我无法解决的问题。我想在Kotlin中扩展Java类RuntimeException并能够在不同的情况下使用它的三个构造函数中的任何一个(基于我当时想要抛出异常的信息))。在java中,我的类看起来像这样:publicclassPhotoLibExceptionextendsRuntimeException{publicPhotoLibException(Stringmessage,RuntimeExceptionex){super(message,ex);}publicPhotoLibException(Stringmessage){super(me

constructor - 如何在 Kotlin 中扩展具有多个构造函数的类?

我正在学习Kotlin,遇到了一个我无法解决的问题。我想在Kotlin中扩展Java类RuntimeException并能够在不同的情况下使用它的三个构造函数中的任何一个(基于我当时想要抛出异常的信息))。在java中,我的类看起来像这样:publicclassPhotoLibExceptionextendsRuntimeException{publicPhotoLibException(Stringmessage,RuntimeExceptionex){super(message,ex);}publicPhotoLibException(Stringmessage){super(me

c++ - 错误 Xcode 5.1 : unknown argument: '-cclib' [-Wunused-command-line-argument-hard-error-in-future]

今天,Apple发布了iOS7.1。所以,我必须下载Xcode5.1才能在iOS7.1上构建。在我的代码中有C语言。但是当我构建时,我有一个错误:unknownargument:'-cclib'[-Wunused-command-line-argument-hard-error-in-future]有人说:这是一个严重的问题,因为clang不支持几个常见的gcc标志(最值得注意的是-mno-fused-madd)那么,我该如何解决这个问题,或者我必须等待Apple的修复版本? 最佳答案 OP的回答:已解决:我找到了这个问题的答案。我

hibernate - 带有 JPA : default constructor hell 的 Kotlin

根据JPA的要求,@Entity类应该有一个默认(非arg)构造函数,以便在从数据库中检索对象时实例化它们。在Kotlin中,在主构造函数中声明属性非常方便,如下例所示:classPerson(valname:String,valage:Int){/*...*/}但是当非参数构造函数被声明为辅助构造函数时,它需要传递主构造函数的值,因此它们需要一些有效值,如下所示:@EntityclassPerson(valname:String,valage:Int){privateconstructor():this("",0)}如果属性有一些比String和Int更复杂的类型并且它们不可为空,那

hibernate - 带有 JPA : default constructor hell 的 Kotlin

根据JPA的要求,@Entity类应该有一个默认(非arg)构造函数,以便在从数据库中检索对象时实例化它们。在Kotlin中,在主构造函数中声明属性非常方便,如下例所示:classPerson(valname:String,valage:Int){/*...*/}但是当非参数构造函数被声明为辅助构造函数时,它需要传递主构造函数的值,因此它们需要一些有效值,如下所示:@EntityclassPerson(valname:String,valage:Int){privateconstructor():this("",0)}如果属性有一些比String和Int更复杂的类型并且它们不可为空,那

ios - Xcode 6.3/iOS 8.3 中的新功能 : using self alloc for convenience constructor causes build error

此代码在Xcode6.2和6.3之间没有变化,但包含[selfalloc]的行现在导致错误:发现多个名为“initWithType:”的方法具有不匹配的结果、参数类型或属性@implementationAGNetworkDataRequest+(instancetype)networkDataRequestWithType:(AGNetworkDataRequestType)type{AGNetworkDataRequest*r=[[selfalloc]initWithType:type];//errorherereturnr;}-(id)initWithType:(AGNetwork