Re: Debugger exits with signal 5 (SIGTRAP) after computer crashed.
Re: Debugger exits with signal 5 (SIGTRAP) after computer crashed.
- Subject: Re: Debugger exits with signal 5 (SIGTRAP) after computer crashed.
- From: Johannes Huning <email@hidden>
- Date: Sun, 9 Dec 2007 14:30:53 +0100
Your suggestion fixed my problem : )
I started playing around with breakpoints and several NSLog messages
to locate the problem. Even the mistake is found, I'm a little confused:
To implement a highlight effect, I created a instance variable as a
trigger ..
BOOL _highlighted;
To implement drag and drop, I added the necessary methods:
- (NSDragOperation)draggingEntered:(id < NSDraggingInfo >)sender;
- (BOOL)prepareForDragOperation:(id < NSDraggingInfo >)sender;
- (void)draggingExited:(id < NSDraggingInfo >)sender;
- (BOOL)performDragOperation:(id < NSDraggingInfo >)sender;
- (void)concludeDragOperation:(id < NSDraggingInfo >)sender;
In these methods I either set highlighted to YES or NO and called
[self setNeedsDisplay:YES]; to update my view. Then, In the drawRect:
method I checked for self.highlighted and displayed either a normal or
a coloured background .. depending on self.highlighted's state.
Now, in the corrupted project (the one with the signal 5, I described
before), self.highlighted was _not_ set to NO (or YES) in the
initialiser (initWithFrame:) - but the app worked just fine. On the
other hand, in this project, I had to set self.highlighted to NO (or
YES in the initialiser) to prevent the app from crashing while the
drag & drop operations.
What's my mistake? Or is there any logical explanation for this
behaviour?
Kinds regards,
Johannes Huning
On Dec 9, 2007, at 5:20 AM, Ron Fleckner wrote:
On 09/12/2007, at 1:41 PM, Johannes Huning wrote:
Dear Cocoa Developers,
I just started programming Objective-C and Cocoa. As a first
Project, I'm creating an application, that generates thumbnails of
files dragged to a custom view. Until now, everything worked fine.
Then while playing around with my app, the computer stopped
responding and I had to turn the Mac of by pressing the power
button for a few seconds.
After the restart, I tried to recompile and start the Application
via XCode. The Build itself succeeds every time, but as XCode tries
to open the App (Build and run), I get this error message in the
log window:
-------------------------------------------
[Session started at ... ]
The Debugger has exited due to signal 5 (SIGTRAP).The Debugger has
exited due to signal 5 (SIGTRAP).
-------------------------------------------
Since I'm quite new to the world of programming, I tried some easy
steps to resolve the problem:
1. Look at the Console:
---------------------------
... Xcode[1072] *** NSTask: Task create for path '/Users/username/
myapp/build/Debug/myapp.app' failed: 13, "Permission denied".
Terminating temporary process.
---------------------------
So I repaired permissions and even tried to set full r+w rights to
a copy of the whole project directory. Sadly, nothing changed.
2. Create a new Project, to which I copied all my classes and the
MainMenu.nib file. The App will build and start, but as soon as I
drag Images into my view - wich worked absolutely well in the (now)
corrupted project before - the debugger starts and the app crashes.
I searched the archive and Google, but unfortunately I weren't able
to find anything that helped me with this matter.
Right now, I have no clue what to do and I'd highly appreciate any
help.
Kind regards,
Johannes Huning
Johannes,
until someone more knowledgable chimes in, I think you should set
breakpoints in the method which is first called when you drag in
images, then breakpoints along whatever chain of methods you have.
Build and Debug (Command-Y), then step from breakpoint to
breakpoint. Maybe you'll see what's happening there. Also, use of
NSLog() is very helpful in these situations.
HTH,
Ron
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden