在-[UIViewController viewWillAppear]方法中添加符号断点时如何注销自身 [英] How to log out self when add a symbol breakpoint at -[UIViewController viewWillAppear] method

查看:75
本文介绍了在-[UIViewController viewWillAppear]方法中添加符号断点时如何注销自身的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经这样做了,但是总是出现错误:

I have done it like this but it always give the error:

error: use of undeclared identifier 'self'
error: 1 errors parsing expression

推荐答案

我不认为您可以从UIKit框架内的断点访问任何符号信息,因为没有可用的调试信息.如果您设置了一个断点并允许调试器打开,您将看到仅显示了一些汇编代码和一组寄存器.

I don't believe that you can access any symbolic information from a breakpoint inside the UIKit framework, because there is no debugging information available. If you set a breakpoint and allow the debugger to open you will see you are just presented with some assembler code and a set of registers.

您可以在应用程序中为特定的UIViewController类设置断点-

You can set a breakpoint for a specific UIViewController class in your application -

您可以添加一个薄垫片UIViewController子类,然后从中子类化所有视图控制器.然后,这将允许您在垫片中指定单个符号断点-

You could add a thin shim UIViewController subclass and then subclass all of your view controllers from it. This would then allow you to specify a single symbolic breakpoint in the shim -

#import "BreakPointingViewController.h"

@implementation BreakPointingViewController

-(void) viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
}

@end

然后将符号断点添加到-[BreakPointingViewController viewWillAppear:]

Then add the symbolic breakpoint in -[BreakPointingViewController viewWillAppear:]

这篇关于在-[UIViewController viewWillAppear]方法中添加符号断点时如何注销自身的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆