草庐IT

unrecognized-selector

全部标签

ios - appname.ViewsVC collectionView :cellForItemAtIndexPath:]: unrecognized selector sent to instance

我正在构建一个CollectionView并收到以下错误。Terminatingappduetouncaughtexception'NSInvalidArgumentException',reason:'-[appname.ViewsVCcollectionView:cellForItemAtIndexPath:]:unrecognizedselectorsenttoinstance这是我自定义单元格的代码//cellconfigurationfunccollectionView(_collectionView:UICollectionView,cellForItemAtindexPa

ios - 为什么 Xcode 在使用 @selector 时不提示未声明的方法?

为什么使用常规方式调用类接口(interface)中未声明的方法时会产生警告,而使用@selector调用方法时却不会?是因为选择器可以由与自身不同的调用者执行吗?例如:-(void)doStuff{[selfdoNow];//Warning:instancemethodnotfoundSELsel=@selector(doNow);//nowarnings}-(void)doNow{}//thismethodisnotdeclaredintheinterface 最佳答案 “未声明的选择器”警告默认关闭。我不知道为什么。您可以在b

iphone - ARC 语义问题 : No visible @interface for Class declares the selector

非常基本的东西,但我无法解决问题所在。在我的项目中,我有一个名为“TheFeedStore”的类,它具有以下两种方法:-(BOOL)hasItemBeenRead:(RSSItem*)item{............}-(void)markItemAsRead:(RSSItem*)item{.........}我正在使用以下类方法,以便其他类可以使用它访问这些方法:+(TheFeedStore*)sharedStore{staticTheFeedStore*feedStore=nil;if(!feedStore){feedStore=[[TheFeedStorealloc]init]

ios - "Unrecognized selector sent to instance"使用自定义表格单元格时

我已经实现了自定义表格单元格,当表格进入cellForRowAtIndexPath时收到运行时错误(“无法识别的选择器发送到实例”)。尝试实例化自定义单元格时发生错误。我之前已经成功地做到了这一点,但现在错误不会消失。我有一个prtotype单元格,它的自定义类属性设置为自定义单元格UITableViewCell子类。这是自定义单元格:#import"FavoriteCell.h"@implementationFavoriteCell@synthesizelblGaugeID,lblMainTitle,bgImage;-(id)initWithStyle:(UITableViewCel

iphone - 行动 :@selector(showAlert:) how to pass parameter in this showAlert method?

我正在向我的UITableViewCell添加自定义按钮。在该按钮的操作中,我想调用showAlert:函数并希望在该方法中传递单元格标签。如何在showAlert方法中传递参数:action:@selector(showAlert:)? 最佳答案 如果您在Tableviewcell中使用Button,那么您必须将标签值添加到每个单元格的按钮,并使用id作为参数设置方法addTarget。示例代码:您必须在cellForRowAtIndexPath方法中键入以下代码。{//Settagtoeachbuttoncell.btn1.ta

DOMException: Failed to execute 'querySelectorAll' on 'Document' is not a valid selector 报错处理...

DOMException:Failedtoexecute'querySelectorAll'on'Document'isnotavalidselector报错处理问题过程今天开发过程中,遇到一个报错信息:react-dom.production.min.js:5058DOMException:Failedtoexecute'querySelectorAll'on'Document':'0bb64d67-b455-4130-9b73-55eda6a1975c8Buu-link-ellipsis'isnotavalidselector.截图1字面意思是:querySelectorAll函数报错,这

c# - 如何使用 MonoTouch.ObjCRuntime.Selector 和 Perform Selector 发送参数

这是我找到的一个例子,但他们忽略了实际发送参数。this.PerformSelector(newMonoTouch.ObjCRuntime.Selector("_HandleSaveButtonTouchUpInside"),null,0.0f);[Export("_HandleSaveButtonTouchUpInside")]void_HandleSaveButtonTouchUpInside(){...}我希望能够做这样的事情:this.PerformSelector(newMonoTouch.ObjCRuntime.Selector("_HandleSaveButtonTouc

IOS: 给@selector 添加一个参数

当我有这行代码时UILongPressGestureRecognizer*downwardGesture=[[UILongPressGestureRecognizeralloc]initWithTarget:selfaction:@selector(dragGestureChanged:)];还有这个-(void)dragGestureChanged:(UILongPressGestureRecognizer*)gesture{...}我想在“@selector(dragGestureChanged:)”处添加一个参数“(UIScrollView*)scrollView”,我该怎么做?

ios - swift : Passing a parameter to selector

使用Swift3、Xcode8.2.1方法:funcmoveToNextTextField(tag:Int){print(tag)}下面的行编译正常,但是tag有一个未初始化的值:letselector=#selector(moveToNextTextField)Timer.scheduledTimer(timeInterval:0.2,target:self,selector:selector,userInfo:nil,repeats:false)但是,我需要传递一个参数。以下无法编译:letselector=#selector(moveToNextTextField(tag:2))

objective-c - 如何在 iOS 中通过参数将 UITableView IndexPath 传递给 UIButton @selector?

我在UITableViewCells中添加了UIButton。当用户单击按钮时,我得到了索引路径以使用NSMutableArray中的值。我使用下面的方法获取当前的IndexPath,[getMeButtonaddTarget:selfaction:@selector(resendTheErrorMessage:)forControlEvents:UIControlEventTouchUpInside];-(void)resendTheErrorMessage:(id)sender{NSLog(@"SEnder:%@",sender);//NSLog(@"IndexPath:%@",i