草庐IT

Instance

全部标签

ios - -[_SwiftValue encodeWithCoder :]: unrecognized selector sent to instance

尝试使用NSCoder时出现错误Player.swift:classPlayer:NSObject,NSCoding{privatevar_playerName:String!privatevar_playerScore:Int!privatevar_playerColor:PlayerColor!//PlayerColorisanenumvarplayerName:String{get{return_playerName}set{_playerName=newValue}}varplayerScore:Int{get{return_playerScore}set{_playerSco

ios - -[_SwiftValue encodeWithCoder :]: unrecognized selector sent to instance

尝试使用NSCoder时出现错误Player.swift:classPlayer:NSObject,NSCoding{privatevar_playerName:String!privatevar_playerScore:Int!privatevar_playerColor:PlayerColor!//PlayerColorisanenumvarplayerName:String{get{return_playerName}set{_playerName=newValue}}varplayerScore:Int{get{return_playerScore}set{_playerSco

ios - Swift 应用程序在 CLLocationManager 上崩溃并显示 `unrecognized selector sent to instance`

与StackOverflow上的许多其他问题类似,在运行我的应用程序时,我遇到了unrecognizedselectorsenttoinstance错误。让我的案例与众不同(我认为)的是它是用Swift编写的,而常见的原因不是这里的原因。在this问题解决方案是在身份检查器中将该View的“自定义类”设置为响应类。我检查了一下,情况确实如此(请注意,我确实在某个时候重命名了该类,但现在它肯定设置为“ViewController”)。我包括下面的堆栈跟踪以及ViewController.swift的代码。您还可以找到所有代码here.我通过重新开始设法避免了这个问题,这使我能够解决我的e

ios - Swift 应用程序在 CLLocationManager 上崩溃并显示 `unrecognized selector sent to instance`

与StackOverflow上的许多其他问题类似,在运行我的应用程序时,我遇到了unrecognizedselectorsenttoinstance错误。让我的案例与众不同(我认为)的是它是用Swift编写的,而常见的原因不是这里的原因。在this问题解决方案是在身份检查器中将该View的“自定义类”设置为响应类。我检查了一下,情况确实如此(请注意,我确实在某个时候重命名了该类,但现在它肯定设置为“ViewController”)。我包括下面的堆栈跟踪以及ViewController.swift的代码。您还可以找到所有代码here.我通过重新开始设法避免了这个问题,这使我能够解决我的e

【ElasticSearch】Kibana启动报错: Another Kibana instance appears to be migrating the index.....

 AnotherKibanainstanceappearstobemigratingtheindex.Waitingforthatmigrationtocomplete.IfnootherKibanainstanceisattemptingmigrations,youcangetpastthismessagebydeletingindex.kibana_1andrestartingKibana.解决:删除出错的索引使用head客户端插件,删除kibana_1、.kibana_task_manager_1节点,重新启动参考:【ElasticSearch】Kibana连接不上(Unabletoco

swift - [SPApplication _accessibilityInitialize] : unrecognized selector sent to instance on watchOS4

一旦我的watch应用程序启动,它就会崩溃并出现以下错误:2017-08-1713:59:54.304792-0300watchOS4Extension[11500:1617313]-[SPApplication_accessibilityInitialize]:无法识别的选择器发送到实例0x79e5b8f02017-08-1713:59:56.173675-0300watchOS4扩展[11500:1617313]***由于未捕获的异常'NSInvalidArgumentException'而终止应用程序,原因:'-[SPApplication_accessibilityInitia

swift - [SPApplication _accessibilityInitialize] : unrecognized selector sent to instance on watchOS4

一旦我的watch应用程序启动,它就会崩溃并出现以下错误:2017-08-1713:59:54.304792-0300watchOS4Extension[11500:1617313]-[SPApplication_accessibilityInitialize]:无法识别的选择器发送到实例0x79e5b8f02017-08-1713:59:56.173675-0300watchOS4扩展[11500:1617313]***由于未捕获的异常'NSInvalidArgumentException'而终止应用程序,原因:'-[SPApplication_accessibilityInitia

iOS Swift 传递关闭作为属性?

假设我有一个自定义UIView,我们称它为MyCustomView。在这个View中有一个UITextField属性。假设我的目标是能够创建MyCustomView的实例并将其添加到某处的某个ViewController,并且我希望该ViewController能够处理对该文本字段采取的操作。例如,如果我在文本字段中的键盘上点击“返回”,我可能想要执行一些操作-让我举一个例子,说明我用一些objective-c伪代码设想的内容:MyCustomView*myView=[[MyCustomViewalloc]initWithFrame:CGRectMake(10,10,100,100)]

iOS Swift 传递关闭作为属性?

假设我有一个自定义UIView,我们称它为MyCustomView。在这个View中有一个UITextField属性。假设我的目标是能够创建MyCustomView的实例并将其添加到某处的某个ViewController,并且我希望该ViewController能够处理对该文本字段采取的操作。例如,如果我在文本字段中的键盘上点击“返回”,我可能想要执行一些操作-让我举一个例子,说明我用一些objective-c伪代码设想的内容:MyCustomView*myView=[[MyCustomViewalloc]initWithFrame:CGRectMake(10,10,100,100)]

ios - 惰性变量给出 'Instance member can not be used on type' 错误

我现在多次遇到此错误,并采取了不同的解决方法,但我真的很好奇为什么会发生这种情况。基本场景如下:classSomeClass{varcoreDataStuff=CoreDataStuff!lazyvarsomethingElse=SomethingElse(coreDataStuff:coreDataStuff)}所以我知道我不能在类完全初始化之前使用self,但在这种情况下,我正在使用self属性coreDataStuff来初始化一个惰性变量,这在我的实例准备好之前不会发生。任何人都可以解释我为什么会这样Instancemembercannotbeusedontype错误?