HUD panel is deallocating itself after close
HUD panel is deallocating itself after close
- Subject: HUD panel is deallocating itself after close
- From: Sam Krishna <email@hidden>
- Date: Wed, 2 Apr 2008 01:12:47 -0400
(Leopard 10.2.5, x86)
As a simple project, I'm trying to implement a HUD panel inside of the
TextEdit codebase. The HUD panel is in a separate nib ("HUD.nib") that
has it's own controller which is separate from the File's Owner class.
I have two classes:
(1) Launcher.[hm] --- this is the File's Owner class.
(2) HUDControlller.[hm]
I've re-wired the "Find..." sub-menu item to launch the panel when
firing showFindPanel:
The HUD panel opens successfully the first time when I use Cmd-F to
"find" something. However, when I close the panel and try to re-open
it, the system acts as if the panel has inadvertently been freed.
Here's the backtrace:
--------
Current language: auto; currently objective-c
Program received signal: “EXC_BAD_ACCESS”.
(gdb) bt
#0 0x906176e8 in objc_msgSend ()
#1 0x0001b142 in -[PanelController showFindPanel:] (self=0x143c4d30,
_cmd=0x1fdf8, sender=0x135530) at /Volumes/elyon/achilles/Projects/
Regex/Prototypes/TextEdit/PanelController.m:30
#2 0x0001b322 in -[Detector showFindPanel:] (self=0x135530,
_cmd=0x1fdf8, sender=0x12f6c0) at /Volumes/elyon/achilles/Projects/
Regex/Prototypes/TextEdit/Detector.m:136
#3 0x9188fe56 in -[NSApplication sendAction:to:from:] ()
#4 0x9193e7cc in -[NSMenu performActionForItemAtIndex:] ()
#5 0x9193e4d1 in -[NSCarbonMenuImpl
performActionWithHighlightingForItemAtIndex:] ()
#6 0x9193e157 in -[NSMenu performKeyEquivalent:] ()
#7 0x9193c9fd in -[NSApplication _handleKeyEquivalent:] ()
#8 0x91859b36 in -[NSApplication sendEvent:] ()
#9 0x917b70f9 in -[NSApplication run] ()
#10 0x9178430a in NSApplicationMain ()
#11 0x00016985 in main (argc=1, argv=0xbffff6b0) at
------
For the record, the code isn't doing anything special. All I did was
re-wire the main menu's Find->Find... submenu item to my Launcher
class in the Edit.nib file. I then used NSBundle to load the secondary
xib, set the File's Owner of the 2nd xib to Launcher, and had it point
to the HUDController, which in turn performs -makeKeyAndOrderFront: on
the HUD Panel when using Cmd-F.
Any ideas?
Sam
_______________________________________________
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