草庐IT

selector-drawable

全部标签

ios - CADisplayLink的displayLinkWithTarget有什么区别 :selector: and UIScreen's displayLinkWithTarget:selector:?

CADisplayLink有这个方法是有道理的,但我很好奇为什么UIScreen也会有它。 最佳答案 文档说屏幕提供的显示链接与该屏幕相关联。但是,查看官方文档,与任何屏幕都没有明显的关系;显示链接被添加到一个运行循环中,仅此而已。挖掘deeperintheprivateheaders,有一个display属性,类型为CADisplay,即alsofoundforUIScreen.看起来,您确实可以创建特定于屏幕的显示链接。通常在iOS和tvOS上,只有一个屏幕,但情况并非总是如此(例如将显示器连接到iOS设备)。如果您的应用支持外

iOS - 出现奇怪的错误 : unrecognized selector sent to instance on a UITableView

简介在我当前的应用程序中,我有一个包含自定义单元格对象的UITableView。自定义UIViewCellObjects只是标准UITableViewCell类的子类。自定义单元格包含有关运行后台上传的信息,并使用完成百分比等更新它们。自定义单元格对象从后台运行的上传进程中监听NSNotifications,当他们收到相关通知时,他们只需使用新信息(例如上传百分比)更新自己的View控件。现在,当上传过程完成后,我重新排序事件上传对象的数组并重新加载tableview,如下所示:-(void)uploadFinished:(NSNotification*)notification{NS

ios - 动态传递@selector

根据ABPersonGetSortOrdering()的结果,我想按名字或姓氏对UILocalizedIndexCollat​​ion进行排序。我在切换用于collat​​ionStringSelector参数的@selector时遇到问题。把这个写得很冗长会很容易:NSArray*sortedSubarray;if(ABPersonGetSortOrdering()==0){sortedSubarray=[collationsortedArrayFromArray:[sectionsobjectAtIndex:section]collationStringSelector:@sele

iphone - UIDeviceRGBColor getRed :green:blue:alpha - unrecognized selector, 不是由于内存管理

我使用CGColorGetComponents解决了我的问题,但我想了解到底是什么原因。我正在使用UIColor*firstColour的实例执行以下操作:[firstColourgetRed:&rgreen:&gblue:&balpha:nil];这在模拟器上运行得非常好。然后我在我的设备上测试了它,并得到了这个错误:UIDeviceRGBColorgetRed:green:blue:alpha无法识别的选择器发送到实例在网上查了一下,发现UIColor其实是被子类代替的,比如UIDeviceRGBColor。很好,但是子类不应该像UIColor一样工作并接受(至少)相同的方法吗?我

objective-c - UIView 子类调用 UIView+Category 方法时抛出 "Selector not found"

我有UIView的子类MyView。我在UIView上还有一个名为UIView+simpleCategory的类别。这个类别声明了一个方法doSomething@interfaceUIView(simpleCategory)-(void)doSomething;@end我在从UIView子类MyView调用doSomething方法时遇到问题。我收到“选择器无法识别”错误。我想知道我需要做什么才能让子类识别其父类(superclass)的类别方法。在我的UIView子类的实例上调用UIView类别方法时出现问题:MyView*view=[[MyViewalloc]init];[view

ios - 应用程序在 [NSIndexPath setTableViewStyle :]: unrecognized selector sent to instance in ipad 上崩溃

2013-03-0617:38:14.764LiveiPad[506:607]-[NSIndexPathsetTableViewStyle:]:unrecognizedselectorsenttoinstance0x57ac402013-03-0617:38:14.785LiveiPad[506:607]***Terminatingappduetouncaughtexception'NSInvalidArgumentException',reason:'-[NSIndexPathsetTableViewStyle:]:unrecognizedselectorsenttoinstance

ios - 错误 : no visible @interface for 'NSObject' declares the selector 'copyWithZone:'

我想允许对我的类对象进行深度复制,并尝试实现copyWithZone但调用[supercopyWithZone:zone]会产生错误:error:novisible@interfacefor'NSObject'declarestheselector'copyWithZone:'@interfaceMyCustomClass:NSObject@end@implementationMyCustomClass-(id)copyWithZone:(NSZone*)zone{//ThefollowingproducesanerrorMyCustomClass*result=[supercopyW

ios - [NSManagedObjectContext 删除 :]: unrecognized selector sent to instance

核心数据让我心烦意乱。我正在删除旧数据并想插入从服务器收到的新数据。现在删除部分给出了一个“sigabort”:-[NSManagedObjectContextdelete:]:unrecognizedselectorsenttoinstance0x522f5502013-09-2714:05:56.592*Terminatingappduetouncaughtexception'NSInvalidArgumentException',reason:'-[NSManagedObjectContextdelete:]:unrecognizedselectorsenttoinstance0

iphone - 应用程序加载程序警告 : The app references non-public selectors in Payload/<Appname>. app/<App name>: changeState:

我有这个应用程序加载器警告,但我不知道它来自哪里。我的应用程序中有facebook和解析sdk。我看过thispost.不过,它对我没有帮助,因为我的问题显然出在名为changeState的东西上。在我为我的应用程序编写的代码中的任何地方都没有调用它。我也不使用facebooksdk,我需要在应用程序中使用parsesdk。我该如何解决这个问题? 最佳答案 changeState在libGoogleAdMobAd.a中使用,它是GoogleAdMob的一部分。我在审核说明中提到了它,我的应用获得了批准。

ios - +[UIPasteboard _accessibilityUseQuickSpeakPasteBoard] : unrecognized selector sent to class

我在AppleDev论坛上问过这个问题,但仍然没有得到答案。我们经历过100%的iOS8设备崩溃:+[UIPasteboard_accessibilityUseQuickSpeakPasteBoard]:unrecognizedselectorsenttoclass堆栈跟踪是:Thread:FatalException:NSInvalidArgumentException0CoreFoundation0x2889ec1f__exceptionPreprocess+1261libobjc.A.dylib0x36049c8bobjc_exception_throw+382CoreFound