• 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: commitEditing and unrecognized selector
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: commitEditing and unrecognized selector


  • Subject: Re: commitEditing and unrecognized selector
  • From: Graham Cox <email@hidden>
  • Date: Wed, 10 Dec 2008 11:01:42 +1100


On 10 Dec 2008, at 10:53 am, Chris Idou wrote:

I've got a modal dialog with a couple of NSTextFields. Changes weren't getting saved, so I thought I'd better call commitEditing on the text field before retrieving its value with stringValue.

But when I call commitEditing on the NSTextField it gives the error: -[NSTextField commitEditing]: unrecognized selector sent to instance

But there are no warnings from the compiler that commitEditing is an invalid method.

What am I doing wrong?


Call -validateEditing instead, that should do what you want.

You don't get a warning because -commitEditing is implemented as a category on NSObject, which means that NSTextField does effectively implement it. It's just that -commitEditing is not the same as - validateEditing.

hth,

Graham


_______________________________________________

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


References: 
 >commitEditing and unrecognized selector (From: Chris Idou <email@hidden>)

  • Prev by Date: commitEditing and unrecognized selector
  • Next by Date: Re: Another NSOutlineView question
  • Previous by thread: commitEditing and unrecognized selector
  • Next by thread: Re: commitEditing and unrecognized selector
  • Index(es):
    • Date
    • Thread