• 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
Re: controlTextDidChange, backspace possible?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: controlTextDidChange, backspace possible?


  • Subject: Re: controlTextDidChange, backspace possible?
  • From: "Peter Karlsson" <email@hidden>
  • Date: Tue, 14 Sep 2004 18:25:53 +0000

You must mean textShouldBeginEditing, right?

Peter


From: John Tsombakos <email@hidden>
To: <email@hidden>
Subject: Re: controlTextDidChange, backspace possible?
Date: Tue, 14 Sep 2004 13:53:11 -0400


> From: "Peter Karlsson" <email@hidden> > Subject: Re: controlTextDidChange, backspace possible? > > Ok, maybe this is better? > > if ([[myTexfieldOutlet stringValue] length] < 33) > > But I still have the problem with my moving cursor. > > Peter

I checked the documentation for NSTextField and there is a delegate message:

- (BOOL)shouldBeginTextEditing:(NSText *)textObject

I set up a simple XCode project with an NSTextField in a window, and set it's delegate to my custom Controller object. In my Controller object, I implemented the shouldBeginTextEditing method, but it was never called (I had an NSLog in there). Am I missing the point of this message? (according to the docs: "If it is editable and its delegate responds to control:textShouldBeginEditing:, invokes that method and returns the result.") and the docs of NSControl's control:textShouldBeginEditing: delegate message says:

"Sent directly by control to the delegate when the user tries to enter a character in a cell of a control that allows editing of text (such as a text field or form field). Return YES if the NSControl?s fieldEditor should be allowed to start editing the text, NO otherwise."

My 2 cents, with a sample that doesn't work...

jt

 _______________________________________________
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

_________________________________________________________________
The new MSN 8: advanced junk mail protection and 2 months FREE* http://join.msn.com/?page=features/junkmail


_______________________________________________
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


  • Prev by Date: Re: [NSString stringWithContentsOfURL:] not working
  • Next by Date: Re: Re: controlTextDidChange, backspace possible?
  • Previous by thread: Re: controlTextDidChange, backspace possible?
  • Next by thread: Re: Re: controlTextDidChange, backspace possible?
  • Index(es):
    • Date
    • Thread