Tag: select器

:无法识别的select器发送到实例…]

在我的iOS应用程序中,我创build了一个具有自定义单元格的表格视图控制器,其中一个包含一个PickerView。 这是自定义单元的类: import Foundation import UIKit class PickerCell: UITableViewCell { @IBOutlet weak var label : UILabel! @IBOutlet weak var pickerView : UIPickerView! func configurePickerCell(labelText:String, pickerDelegate:MyPickerViewController, enabled:Bool, defaultValueIndex:Int) { self.label.text = labelText var labelFrame:CGRect = self.label.frame labelFrame.size.height = Settings.labelHeight self.label.frame = labelFrame self.pickerView.delegate = pickerDelegate self.pickerView.dataSource = pickerDelegate if (enabled) { self.pickerView.userInteractionEnabled = true } else […]

有问题与UISplitViewController

我创build了一个字典应用程序,我正在使用UISplitViewController来search和select一个单词,我的应用程序崩溃与此日志: -[MeaningViewController topViewController]: unrecognized selector sent to instance 0x7f918945bef0 Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[MeaningViewController topViewController]: unrecognized selector sent to instance 0x7f918945bef0' 这里是我的代码:在ViewController (MasterView) : – (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { [_searchbar resignFirstResponder]; if ([segue.identifier isEqualToString:@"Meaning"]) { //MeaningViewController *meaningVC = (MeaningViewController*)[[segue destinationViewController] topViewController]; UINavigationController *navController = (UINavigationController *)segue.destinationViewController; MeaningViewController *meaningVC = (MeaningViewController *)navController.topViewController; […]

无法识别的select器被调用

在我的应用程序中,我使用注释显示地图,用户可以在表格视图(模式视图控制器)中浏览注释列表。 我遇到了一个奇怪的错误,我可以在设备和模拟器(iOS 7和8)上重现。 在倾斜模式下,如果我尝试在POI表格视图中select一个项目,它将执行以下操作之一: 将地图中心更改为地图上的随机点,而不是选定的注释。 崩溃与我放在消息(NSZombies启用)。 – [__ NSCFString isPitched]:无法识别的select器发送到实例0x7f24e6e0 我尝试了几种方法来解决这个错误,但没有成功。 而令我感到困惑的是,我无法在isPitched方法上find任何信息。 这不是在我的代码中,也不在苹果文档中。 有人知道更多关于MapKit和这些types的问题? 另外,当用户在列表中select一个POI时,你是否知道一种停用音高的方法? 也许它会阻止错误。 编辑:只是发现'isPitched'方法实际上是VectorKit的一部分! 虽然没有真正的帮助。 没有关于VectorKit的文档… 编辑2:添加堆栈跟踪。 – [__ NSCFString isPitched]:无法识别的select器发送到实例0x7db84870 2015-02-28 14:25:08.501 Cartel 2015 [2481:178443] ***终止应用程序由于未捕获的exception“NSInvalidArgumentException”,原因:' – [__ NSCFString isPitched]:无法识别的select器发送到实例0x7db84870' ***第一个投掷堆栈: ( 0 CoreFoundation 0x00afb946 __exceptionPreprocess + 182 1 libobjc.A.dylib 0x00784a97 objc_exception_throw + 44 2 CoreFoundation 0x00b035c5 – [NSObject(NSObject)doesNotRecognizeSelector:] + 277 […]

NSTimer在启动时会导致“无法识别的select器”崩溃

我正在使用NSTimer运行一个animation(现在只是称之为myMethod )。 但是,它造成了一个崩溃。 代码如下: @implementation SecondViewController // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. – (void) myMethod { NSLog(@"Mark Timer Fire"); } – (void)viewDidLoad { [super viewDidLoad]; NSLog(@"We've loaded scan"); [NSTimer scheduledTimerWithTimeInterval:2.0 target:self selector:@selector(myMethod:) userInfo:nil repeats:YES]; animationTimer = [NSTimer scheduledTimerWithTimeInterval: 1.0 target:self selector:@selector(myMethod:) userInfo:nil repeats: YES]; } 这是崩溃期间的输出 […]

快速执行select器与对象3

我想在swift 3.0中用对象执行select器 我有一个select器有一个参数 func imageSelected(aImage : UIImage) 我就是这样称呼的 viewC.perform(Selector.init("imageSelected:"), with: image, afterDelay: 0.1) 但是,应用程序崩溃,select器没有定义的错误。

无法添加目标UIButton – 无法识别的select发送到实例,尽pipe方法在同一个类

我有一个名为StickerClass的Objective-C iOS类中的UIButton。 该类有一个名为“theView”的UIButton的公共实例。 在StickerClass的构造函数中,我设置了初始属性,如框架,图层属性和子视图,以及它被点击的目标,使用: [theView addTarget:self action:@selector(aMethod:) forControlEvents:UIControlEventTouchUpInside]; 有一个名为TopViewController的顶级类,它创build了一个StickerClass实例,然后使用公共访问variablestheView(在一个StickerClass实例中的UIButton),将该button添加到TopViewController中(使用[self.view addSubview:[myInstance theView]] )。 回到StickerClass,我有这个方法: – (void)aMethod:(UIButton*)button { NSLog(@"Do some stuff…"); } 在标题中,我在@end之前签名: – (void)aMethod:(UIButton*)button; 但是当我点击button时,由于select器无法识别,会引发SIGABRT错误。 错误是: 2014-09-06 21:13:23.448 Shy[6523:60b] -[UIControlTargetAction aMethod:]: unrecognized selector sent to instance 0x10922ca70 2014-09-06 21:13:23.450 Shy[6523:60b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIControlTargetAction aMethod:]: unrecognized selector sent to instance […]

NSInvalidArgumentException“无法识别的select器发送到实例”(使用MPMoviePlayerController)

那么,我有一个具有DetailViewController的RootViewController中的TableView,用于显示单个logging的信息。 在详细信息页面我必须播放一个多媒体文件,并使用框架MediaPlayer,根据本指南: http : //www.techotopia.com/index.php/Video_Playback_from_within_an_iOS_4_iPhone_Application 似乎一切都好,但是当我点击播放button时,我有这个错误: -[DetailsViewController playmovie]: unrecognized selector sent to instance 0x9117f60 *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[DetailsViewController playmovie]: unrecognized selector sent to instance 0x9117f60' 这些是我的文件: 在AppDelegate中,我使用这个导航控制器: […] // Create a table view controller RootViewController *rootViewController = [[RootViewController alloc] initWithStyle:UITableViewStylePlain]; rootViewController.managedObjectContext = context; rootViewController.entityName = @"Porti"; UINavigationController *aNavigationController = […]

numberOfSections被调用? iOS版

跳过所有这些信息并跳到底部的更新… 我之前已经处理了无法识别的select器,但我无法弄清楚这次发生了什么。 调用堆栈是不透明的,我不能找出问题来自哪里。 我曾尝试使用符号和exception断点。 这个代码之前完美的工作..我回来这个程序更多的工作,现在正在运行到这个 [UITableViewSectionElement numberOfSections]: unrecognized selector sent to instance 0xa285d50 在这个视图控制器中有两个UITableViews 。 其中之一就是IB(datasource and delegate) 。 第二个在代码中实例化,其数据源/委托也指向视图控制器。 我在第二个tableview上放置了一个标签2来区分它们。 UITableViewTwo添加到UIView作为第一个tableview的页脚返回,如果我有有效的数据显示。 再一次,这段代码在一段时间内没有任何崩溃的情况下运行得很完美,我似乎无法弄清楚为什么现在崩溃了。 我正在使用ARC。 这里是一些代码: 当我检查发送给select器的对象的地址是:它确实是一个UITableViewSectionElement 。 为什么H这是接到号码的电话号码? 是不是应该是numberOfSectionsInTableView ? UITableView Delegate/DataSource methods -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { if (tableView.tag == 0) { if (indexPath.row == 0) { PCFCustomNumberReviewsCell *cell = [self.tableViewOne dequeueReusableCellWithIdentifier:@"PCFNumberOfRatings"]; [cell.numberOfReviews […]

iOS 5中的“定义”编辑菜单项的select器

我正在build立自己的自定义编辑菜单(UIMenuController),并使用典型的 -(BOOL)canPerformAction:(SEL)action withSender(id)sender 方法来有条件地启用/禁用系统默认值。 典型的编辑方法有很好的logging(copy :, cut :,等等),但是我找不到任何有关“Define”菜单选项调用什么方法来提取iOS 5中的新单词词典的问题。隐藏在明显的视野中,但我花了几个小时寻找它,所以我会很感激任何帮助。 具体来说,我需要: if (action == @selector(defineWord:)) …… 但是给我一个真正代替“defineWord”的地方: PS – 我不介意知道该方法属于什么类,只是出于好奇(例如,复制:属于UIResponderStandardEditActions)

将parameter passing给Swift中的Selector

我正在构build一个跟踪大学课程阅读作业的应用程序。 每个ReadingAssignment都包含一个Bool值,用于指示阅读者是否完成阅读任务。 ReadingAssignments被收集到WeeklyAssignment数组中。 我希望让用户能够触摸标签,并出现复选标记,并将分配显示为已完成。 我想这个接触也更新.checked属性为true,所以我可以坚持数据。 所以,我试图让gestureRecognizer调用labelTicked()方法。 这工作和打印到控制台。 但是,当我尝试传递赋值参数时,它会编译,但碰到“无法识别的select器”错误。 我已经阅读了我可以在这里find的每一个主题,并且没有find解决scheme。 他们都说“:”表示带有参数的select器,但还是没有。 你能看到我做错了吗? func configureCheckmark(cell: UITableViewCell, withWeeklyAssignment assignment: WeeklyAssignment) { let checkLabel = cell.viewWithTag(1002) as! UILabel checkLabel.userInteractionEnabled = true let gestureRecognizer = UITapGestureRecognizer(target: self, action: Selector("labelTicked:assignment")) checkLabel.addGestureRecognizer(gestureRecognizer) } @objc func labelTicked(assignment: WeeklyAssignment) { assignment.toggleCheckmark() if assignment.checked { label.text = "✔︎" } else { label.text = "" } […]