开发者

Uncaught exception in iPhone Obj C method causing crash. How to resolve / handle?

I have a crash, and I can't see why it's occurring. I'd like to get more info on it.

The method that this is crashing in is:

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event

when I execute this line of code during debug step through:

[self.nextResponder manageTouc开发者_如何转开发hes:touches];

this is displayed in the file history list:

asm__TERMINATING_DUE_TO_UNCAUGHT_EXCEPTION__ 0x01c1c000:1

The manageTouches method is in the parent object (a view controller).

Any tips for how to resolve are appreciated // :)


Use the Objective-C @try ... @except syntax. You can read up on it in the Exception Handling section of the Objective-C 2.0 language documentation.


There could be a difference between the parent object (your view controller) and the nextResponder you are sending the message to. In the debugger you can make sure the pointers are the same. I would imagine there is some discrepancy here between the responder chain and the view hierarchy ownership chain.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜