• 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: Problems Subclassing NSDateFormatter in IB
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problems Subclassing NSDateFormatter in IB


  • Subject: Re: Problems Subclassing NSDateFormatter in IB
  • From: "Louis C. Sacha" <email@hidden>
  • Date: Mon, 11 Oct 2004 13:48:26 -0700

Hello...

You can do this in IB, but you will need to detach the NSDateFormatter instance you already added to the text field.

Drag a new NSDateFormatter instance from the pallette, but instead of dragging it to the NSTextField instance, drag it to the main nib window so that it becomes a top level nib object. You can use the inspector window to change the custom class to your subclass of NSDateFormatter, and to set up the basic settings for the formatter. Then all ypu have to do is make a connection from the NSTextField to that instance and hook it up to the "formatter" outlet of the NSTextField.

You can also use this method in order to reuse the same formatter for multiple text fields, by connecting the "formatter" outlet of all of the text fields to the same NSFormatter instance.

Hope that helps,

Louis


I have an NSTextField which I attached an NSDateFormatter to in IB. However, I want to use a subclass of NSDateFormatter that I have.

I "Read Files.." in just fine, however, when I click on the NSTextField, the Info->Formatter still states "NSDateFormatter" and when I go to Info->Custom Class, the new subclass doesn't appear(yet it DOES appear in the class hierarchy in the MainMenu.nib window).

How do I apply the new NSDateFormatter subclass? I figure I must have to remove the NSDateFormatter first, but how do I apply the new subclass to the NSTextField in IB?

Michael


_______________________________________________
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
References: 
 >Problems Subclassing NSDateFormatter in IB (From: Michael Hanna <email@hidden>)

  • Prev by Date: Re: bookmarks bar
  • Next by Date: Re: Calling a method based on a string
  • Previous by thread: Re: Problems Subclassing NSDateFormatter in IB
  • Next by thread: Putting things in subfolders in Resources folder
  • Index(es):
    • Date
    • Thread