草庐IT

unrecognized

全部标签

ios - 单击按钮时 Swift "unrecognized selector sent to instance"

这个问题在这里已经有了答案:Swiftunrecognizedselectorsenttoinstance-WhatamImissing?(1个回答)关闭5年前。我试图让一个按钮点击工作,但我得到的只是下面的错误。这是关键代码letbutton=UIButton(frame:CGRect(x:0,y:0,width:200,height:40))button.center=CGPoint(x:260,y:220)button.setTitle(NSLocalizedString("READONLINE",comment:"Button"),for:.normal)button.back

ios - Swift:使用协议(protocol)扩展导致 "unrecognized selector sent to instance"

我正在尝试向所有符合MyProtocol协议(protocol)的UIViewController添加点击功能。下面是我的做法:importUIKitprotocolMyProtocol:class{varfoo:String?{getset}funcbar()}extensionMyProtocolwhereSelf:UIViewController{funcbar(){print(foo)}}classTestViewController:UIViewController,MyProtocol{varfoo:String?overridefuncviewDidLoad(){supe

IOS - Facebook 登录按钮 : Unrecognized selector error

我是iOS和Swift的新手,所以请原谅我对这个问题的无知。我正在尝试将Facebook登录按钮添加到我的Main.storyboard。我添加了一个View对象并将View的类设置为FBSDKLoginButton。但是,当我在模拟器中运行该项目时,它因无法识别的选择器错误而崩溃。据此,https://developers.facebook.com/docs/ios/troubleshooting#unrecognizedselector,我需要在我的应用程序委托(delegate)中添加[FBSDKLoginButtonclass];或添加-ObjC链接器标志。问题是,Swift中

ios - 符合 Codable 协议(protocol)的类因 encodeWithCoder : unrecognized selector sent to instance 而失败

我知道有几个与此类似的问题,它们往往都围绕着未正确遵守协议(protocol)的类展开,但这不应该是这里的直接问题。以下是目前给我这个问题的代码的浓缩版:enumBinary:Int{casea=0caseb=1casec=9}finalclassMyClass:NSCoder{varstring:String?vardate:Date?varbinary:Binary=.coverrideinit(){}enumCodingKeys:CodingKey{casestring,date,binary}}extensionMyClass:Codable{convenienceinit(f

swift - 无法将 Swift 4 字符串传递给 Obj-C++ -[_SwiftValue dataUsingEncoding :]: unrecognized selector sent to instance

我有一些像这样的Objective-C++代码://header@interfaceMyObjcClass-(void)myMethod:(NSString*)text;@end//implementation@implementationMyObjcClass-(void)myMethod:(NSString*)text{someInternalObject->useWstring(nsStringToWstring(text))}std::wstringnsStringToWstring(constNSString*text){NSData*data=[textdataUsingE

iOS - [CLPlacemark 时区] : unrecognized selector iOS 8

我正在使用此方法从lat/long获取timeZone。-(void)getTimeZoneFromLatLong{CLLocation*location=[[CLLocationalloc]initWithLatitude:self.parentVC.currentCity.latitude.doubleValuelongitude:self.parentVC.currentCity.longitude.doubleValue];CLGeocoder*geoCoder=[[CLGeocoderalloc]init];[geoCoderreverseGeocodeLocation:lo

ios - "unrecognized selector sent to instance"在 react-native 上设置属性时

我正在尝试将我的SwiftView与我的React-Native项目链接起来。我想出了如何显示它,但现在当我尝试设置一个属性时,我收到了这条错误消息:Terminatingappduetouncaughtexception'NSInvalidArgumentException',reason:'-[SwitchsetMessage:]:unrecognizedselectorsenttoinstance0x7f96b270de70'在我的react-native代码中,我正在做:constSwitchNative=requireNativeComponent('Switch',Swit

iOS 11 及更高版本崩溃 -[UIView setDrawsWithVibrantLightMode :]: unrecognized selector sent to instance

我注意到iOS11及更高版本上的应用程序崩溃显着增加并出现此消息。这似乎是UIKit正在调用的内部API,堆栈跟踪显示它在UITableViewCell中:ApplicationSpecificInformation:***Terminatingappduetouncaughtexception'NSInvalidArgumentException',reason:'-[UIViewsetDrawsWithVibrantLightMode:]:unrecognizedselectorsenttoinstance0x15defa6d0'LastExceptionBacktrace:0Co

ios - UIButton 点击​​崩溃不实现 methodSignatureForSelector : -- trouble ahead Unrecognized selector

在Swift中,当按下按钮时,应用程序会因错误而崩溃doesnotimplementmethodSignatureForSelector:--troubleaheadUnrecognizedselector在代码中,我的一个Controller类获取对UIButton的引用并添加如下所示的目标aButton.addTarget(self,action:"pressed:",forControlEvents:UIControlEvents.TouchUpInside)按下的函数定义为funcpressed(sender:UIButton){println("buttonpressed")

java - key 斗篷错误 : Unrecognized field "access_token"

我正在使用keycloak来保护我的restAPI,我遵循了这个tutorial以编程方式添加用户,但我收到错误消息:ERROR[io.undertow.request](defaulttask-9)UT005023:Exceptionhandlingrequestto/service/secured:org.jboss.resteasy.spi.UnhandledException:javax.ws.rs.client.ResponseProcessingException:javax.ws.rs.ProcessingException:com.fasterxml.jackson.d