[newbie] access the controller for the current window
[newbie] access the controller for the current window
- Subject: [newbie] access the controller for the current window
- From: Barry McClure <email@hidden>
- Date: Wed, 17 Aug 2005 15:40:29 -0700 (PDT)
I subclassed NSTableView to capture keydown events.
The method that i want fired when a certain key is
pressed is in the controller class for application. It
doesn't fire the method.
someController (in the following code) is nil. What
have I done wrong?
Thanks for anyhelp.
Barry
<snip>
-(void)keyDown:(NSEvent *)theEvent {
unichar key = [[theEvent
charactersIgnoringModifiers] characterAtIndex:0];
if (key == NSDeleteCharacter && [self
numberOfRows] > 0 && [self selectedRow] != -1)
{
id Window = [self window];
if (Window == nil)
{
NSRunAlertPanel(@"Something's
wrong",@"window is nil",@"OK",@"Cancel",nil);
}
id someController = [[self window]
windowController];
if (someController == nil)
{
NSRunAlertPanel(@"Something's
wrong",@"controller is nil",@"OK",@"Cancel",nil);
}
[someController deleteLDAPAttribute:self];
}
else
{
[super keyDown:theEvent];
}
</snip>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden