PDA

View Full Version : weird crashing




liptonlover
Nov 6, 2008, 11:54 AM
I just added a few things to my app since logging on. Just some minor things, most of it not even code. Then I built and ran my app. But I get greeted with a black screen in the sim. Heres the details.

black screen.
status bar visible, the very first thing I do is hide it.
I have the debugger open. As soon as I click on the screen, I get the following.
thread 0 is titled asm__TERMINATING_DUE_TO_UNCAUGHT_EXCEPTION__
The highlighted line is as follows.
0x920d6ff4 <+0004> leave
The sim won't respond until I stop the task, then it goes to the home screen.

Here's what changes I made, in order, to the application.

First, in IB.
I added a couple buttons with custom graphics to a view. The buttons were copied from another view in the app, I know they don't cause it to freeze.
Then I added two labels and changed their text.
I added a partially opaque brown view, short but as wide as the superview, to the view, under the text and buttons.
I added a UITextView to another view, and edited the text. Then I set it to uneditable.
I went through my various views and set all my other UITextViews to uneditable, some of them already were.

In Xcode, after that,
I deleted a line of comment.
I added the following to a header file.
id topView;
I added the following code to a method in the implementation file for the class.
topView=sender;

At that point I compiled and ran, getting the results I got. So, going backwards, I started undoing what I did, except I didn't put the comment back. I commented out each of the above lines of code, in turn, and tried compiling. It still wouldn't work. So I deleted the various interfact objects, one by one, it still wouldn't work. I don't know what else to do. I don't know how to use the debugger, so if that's the solution I wouldn't know. But anyways, as far as I can tell it should be solved by now, whatever it was. What do I do?????? :confused::confused::confused::confused::confused::confused::confused::confused::confused::confused:
Nate



jnic
Nov 7, 2008, 04:11 AM
Take a look through the threads drop-down in the debugger (top left, "Thread-0", "Thread-1", etc.) to see if you can find the method it's stopped in (these will appear in black in the left pane).

Are you getting any compiler warnings when you build that might indicate a problem? Do a clean first so it picks them all up.

liptonlover
Nov 7, 2008, 06:22 AM
Clean rebuild didn't give me anything.
There's a list of threads in a tableview, is that what you mean? In that case it's my main thread, which is last in the list at #8. Here's the line it highlighted.
int retVal = UIApplicationMain(argc, argv, nil, nil);
I never touched main... ever.

jnic
Nov 7, 2008, 08:17 AM
Top left, beneath the word "Interrupted", there is a drop-down list of threads. Each selected thread will populate the table beneath with a set of methods. Hunt for the ones in black which are names of your own classes. Selecting these will show you the line in your class where the exception occurred.

liptonlover
Nov 7, 2008, 08:34 AM
There's three threads, none of them have my code even though I have two classes filled with code. I don't think it got far enough, because as I said it's crashing before it even calls my first line of code. Also I tried finding my variables using the global browser, but they're not there. I was doing that because I read up on the debugger so hopefully I can be more useful here.
I pressed continue after the crash registered in the debugger, and it went to the following.
thread 1, #0 asm_objc_fatal
0x96b8ab19 <+0095> ud2a
Status bar still says program received signal: "EXC_BAD_INSTRUCTION".
Pressing continue any more doesn't do anything. It stays right there. And I still don't see my classes/methods.

jnic
Nov 7, 2008, 09:20 AM
Anything useful in the console?

liptonlover
Nov 7, 2008, 09:27 AM
Problem solved. The console said I had some objects in IB that I didn't have in in xcode. I had created a couple custom classes, in IB, a couple days ago, because that's how I usually create objects that will be connected to the interface. I didn't know the class files have to be written first. I guess we learn something new every day lol.
Thanks a million!
Nate