• 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
View-based tableview and outlets to NSFormatters
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

View-based tableview and outlets to NSFormatters


  • Subject: View-based tableview and outlets to NSFormatters
  • From: Sean McBride <email@hidden>
  • Date: Wed, 01 Apr 2015 14:05:00 -0400
  • Organization: Rogue Research Inc.

Hi all,

I swear this was discussed, but can't find it in the archives...

It seems Interface Builder won't let me connect the 'formatter' outlet of a textfield that's within a view-based tableview to a top-level formatter that lives in the same nib.  It complains:

 "Unsupported Configuration: Outlet 'formatter' of 'Text Field Cell - Table View Cell' is connected to 'Date Formatter,' an invalid destination (Objects inside view based table views may only be connected to the table view's delegate.)"

I often have top-level formatters in my nibs, ex: a number formatter configured to show exactly 2 decimal places.  Then I have a bunch of textfields (some in tables, some not) that connect to it.

How can I do this with view-based tables?

It seems I could:

1) drag a formatter in IB to each table cell.  Downsides: I risk their settings becoming out-of-sync with each other.  Also, formatters are supposedly expensive to create.

2) implement the tableView:viewForTableColumn:row: delegate method to set the formatter.  Downsides: need to write code; most of my tables use bindings and I often don't have a delegate; need to assign column identifiers and switch on them.

Is there no better way?

Thanks,

--
____________________________________________________________
Sean McBride, B. Eng                 email@hidden
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada



_______________________________________________

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


  • Follow-Ups:
    • Re: View-based tableview and outlets to NSFormatters
      • From: Shane Stanley <email@hidden>
  • Prev by Date: Re: Number formatter errors
  • Next by Date: Re: Help Bundle Trouble...
  • Previous by thread: Re: Number formatter errors
  • Next by thread: Re: View-based tableview and outlets to NSFormatters
  • Index(es):
    • Date
    • Thread