• 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
Combo box data validation question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Combo box data validation question


  • Subject: Combo box data validation question
  • From: Josh Anon <email@hidden>
  • Date: Fri, 21 Jun 2002 09:36:18 -0700

So I have this nifty little nib with a popup menu and a combo box. The popup menu contains various fields, each of which will take a different type of data (e.g. there's a "Name" item which will take a NSString and a "Date" item which will take a NSDate, etc.). Then, I have a combo box so that either the user can type in a value (e.g. you'd type in a name) or select a value from a list if it's appropriate (e.g. if the field we're working with takes a boolean).

What I'd like to be able to do is take the value the user types in and check and see if it's the right type--did the user actually type in a date or did he type in a number. My first thought was NSFormatter, but that doesn't seem appropriate. Second thought was to call -objectValue: on the combo box and see if -isKindOfClass:neededClass. However, -objectValue: is always returning a string; I'm guessing this is because a combo box is a subclass of a text field, and anything the user types can be a string.

Any thoughts on how to do the type of data validation I'm looking for? Didn't see this in the archives :)

Thanks,
Josh
_______________________________________________
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: How to print NSOpenGLView ?
  • Next by Date: Re: NSTree ??
  • Previous by thread: How to print NSOpenGLView ?
  • Next by thread: Re: Combo box data validation question
  • Index(es):
    • Date
    • Thread