Re: should it crash?
Re: should it crash?
- Subject: Re: should it crash?
- From: Mudi Dandan <email@hidden>
- Date: Mon, 29 Dec 2008 03:35:47 +0100
On 29 Dec 2008, at 12:08 pm, Mudi Dandan wrote:
This is a overwriting confirmation dialog for file copying (very
much like Finder's) and I'm releasing the view because it's not
needed anymore after the user has chosen.
Terminology matters. By 'view' do you mean panel/window? I took
'view' to mean an NSView, i.e. the button.
Sorry for the confusion.
Actually it's NSViewController with a view (this view has the buttons
on it) which I call panel/view inconsistently.
When user confirmation needed I create a NSViewController and add it's
view to a window and display it to the user.
8. remove and release panel
Here I should have written "remove the NSView from the window and
release it's NSViewcontroller"
....
....
....
9. ??? Update the button and crash
Why are these steps in this order? In fact why do you even need to
update the button at this point at all - its window has gone. When
the window is released it releases all its subviews, including the
button.
Just leave out step 9.
Update is done by the system not by me. I guess it just want to redraw
the button after the event.
I learned that if do step 7. in the button's action handler everything
works fine.
Here is a stacktrace:
*** -[NSButton drawCell:]: message sent to deallocated instance 0x5cd5f0
..
..
..
#0 0x95ddc907 in ___forwarding___ ()
#1 0x95ddca12 in __forwarding_prep_0___ ()
#2 0x9604eae6 in -[NSButtonCell performClick:] ()
#3 0x96021e81 in -[NSButton performKeyEquivalent:] ()
#4 0x96021cee in -[NSControl _performKeyEquivalent:conditionally:] ()
#5 0x96021bba in -[NSView performKeyEquivalent:] ()
#6 0x96021bba in -[NSView performKeyEquivalent:] ()
#7 0x96021bba in -[NSView performKeyEquivalent:] ()
#8 0x96021bba in -[NSView performKeyEquivalent:] ()
#9 0x96021bba in -[NSView performKeyEquivalent:] ()
#10 0x96021bba in -[NSView performKeyEquivalent:] ()
#11 0x96021923 in -[NSWindow performKeyEquivalent:] ()
#12 0x96183336 in -[NSWindow keyDown:] ()
#13 0x95ffdec7 in forwardMethod ()
#14 0x95ffdec7 in forwardMethod ()
#15 0x95ffdec7 in forwardMethod ()
#16 0x95ffdec7 in forwardMethod ()
#17 0x96108917 in -[NSControl keyDown:] ()
#18 0x95f723a5 in -[NSWindow sendEvent:] ()
#19 0x95f3e311 in -[NSApplication sendEvent:] ()
#20 0x95e9bd0f in -[NSApplication run] ()
#21 0x95e68f14 in NSApplicationMain ()
#22 0x0000276e in start ()
_______________________________________________
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