• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Field editor problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: Re: NSDocument:windowControllerDidLoadNib && When are outlets connected to te loaded nib?
  • Next by Date: Re: NSDocument:windowControllerDidLoadNib && When are outlets connected to te loaded nib?
  • Previous by thread: Re: Ordering windows when the application is hidden
  • Next by thread: Saving ruler markers to defaults
  • Index(es):
    • Date
    • Thread