Field editor problem
Field editor problem
- Subject: Field editor problem
- From: Nico <email@hidden>
- Date: Fri, 16 Aug 2002 17:50:07 +0200
Hi.
I subclassed NSDocument (MyDocument) in order to implement more methods for
my newly-created documents.
Each of my documents contains only one window and I need to set the keyboard
focus into a NSPanel's NSTextField when this window become main.
Therefore, I implemented -windowDidBecomeMain like this :
- (void)windowDidBecomeMain:(NSNotification *)notification
{
[myTextField makeKeyWindow];
[myTextField selectText:0];
[[myPanel fieldEditor:YES forObject: myTextField]
setSelectedRange:NSMakeRange([[myTextField stringValue] length], 0)];
}
Sometimes (very randomly tho), I get a spinning cursor of death while
executing this code (at least, that's what gdb shows me when I pause the
execution of the app).
Any ideas ?
++ Nico
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.