`
zani
  • 浏览: 356520 次
  • 性别: Icon_minigender_1
  • 来自: 福州
社区版块
存档分类
最新评论

定位unrecognized selector sent to instance异常

 
阅读更多



 Unrecognized selector is an exception, and you can set a breakpoint on exceptions.

In Xcode 4, go to the breakpoint navigator, click the +, and choose "Add Exception Breakpoint". Under Exception, choose Objective-C. Under Break, choose On Throw. It should look like this when you're done: 

 

  • 大小: 81.7 KB
分享到:
评论

相关推荐

    SceneDelegate:[AppDelegate setWindow:]: unrecognized selector sent to instance 0x60000002b440

    -[AppDelegate setWindow:]: unrecognized selector sent to instance 0x60000002b440 修改方法: 在AppDelegate.h里加声明window @property (nonatomic, strong) UIWindow * window; 运行问题解决 兼容13和13以前...

    iOS 拦截奔溃 使程序不在崩溃

    这些库通常会自动捕获常见的异常,提供统一的日志记录和上报机制,使得开发者能够更快地定位和修复问题。 总的来说,通过异常处理、Runloop观察和第三方库,开发者可以在iOS应用程序中有效地拦截和处理奔溃,提高...

    解决JSON数据因为null导致数据加载失败的方法

    尽管URL是正确的,但依然可能会收到错误信息,如`reason: '-[NSNull length]: unrecognized selector sent to instance`。这是因为`NSJSONSerialization`在解析JSON时,将JSON中的`null`值转换为了`NSNull`对象。而`...

    APTargets:以正确的方式添加UIControl目标

    -[MyProject.ViewController buttonTapped]: unrecognized selector sent to instance 0x7f9b42d48ae0 ...然后恭喜,您是iOS开发人员。 我们都讨厌选择器,现在您可以彻底消除它们。 用法 UIControl + Target....

    ios xcode警告与错误的分析总结

    1.相同具有外部链接的静态变量 ...iOS7.0以下『containsString』报 __NSCFString containsString:]: unrecognized selector sent to instance在要使用的时候导入#import “NSString+Extension.h” 的扩展即可 - (B

    Objective-C:iOS原生开发语言Objective-C。从0到1开始的demos

    reason: '-[ViewController redBtn]: unrecognized selector sent to instance 0x7ff62ff05750' 多余的连线没有删除(创建了多余的IBAction) reason: '[<ViewController> setValue:forUndefinedKey:]: this class is ...

    iOS对象指针和基础数据类型的强转详解

    本文主要介绍了iOS中对象指针和基础数据类型如何进行强转,下面话不多说,直接来看示例详解。 一、对象指针的强转: ...-[UIView setText:]: unrecognized selector sent to instance 0x7ff1e14e03

    iOS消息转发机制及避免崩溃的解决方案.pdf

    如果在`forwardInvocation:`中仍然无法处理消息,那么系统会抛出一个`NSInvalidArgumentException`,表示“unrecognized selector sent to instance”。 利用消息转发机制,开发者可以实现一些高级功能,如动态方法...

    ios runtime消息转发机制

    当对象收到一个消息但无法处理时,通常会引发一个未定义的方法( unrecognized selector sent to instance )异常。然而,通过消息转发,对象有三次机会来处理这个未定义的消息,从而避免程序崩溃。 1. **方法签名...

    iOS 12适配以及问题小记

    具体表现为尝试调用`isEqualToString:`方法时,系统抛出了`unrecognized selector sent to instance`异常。这是因为StatusBar中的某些标识符类型不再是`NSString`,而是 `_UIStatusBarIdentifier` 类,这个类没有`...

    NSObjectSafe:Swizzle Foundation容器的常用功能可防止nil崩溃

    然而,处理`nil`对象时常会导致程序崩溃,特别是当调用一个不存在的方法时,会触发“unrecognized selector sent to instance”错误。为了解决这个问题,开发者们创造了一种技术叫做`Swizzling`,它允许我们在运行时...

    常见iOS错误解决方案

    #### 十二、`unrecognized selector sent to instance` **问题描述:** 对象接收到未识别的选择器消息。 **解决方案:** 1. 检查发送给对象的消息是否正确。 2. 确保对象的类型与预期一致。 3. 查看对象是否实现了...

    加载带有手势识别器的XIB文件需注意哪些问题

    - 如果出现“unrecognized selector sent to instance”错误,这通常意味着你尝试调用的方法在一个不支持该方法的对象上执行。在这种情况下,可能是由于XIB加载时选取了错误的对象,导致手势识别器与错误的目标关联...

    iOS中json解析出现的null,nil,NSNumber的解决办法

    -[NSNull length]: unrecognized selector sent to instance 0x388a4a70 ``` 2. **解决方法** - **临时解决方案**:在访问字段之前进行条件判断,检查该字段是否属于`NSNull`类。例如: ```swift if (!...

Global site tag (gtag.js) - Google Analytics