• 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: Making a text cell in a table editable
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Making a text cell in a table editable


  • Subject: Re: Making a text cell in a table editable
  • From: "I. Savant" <email@hidden>
  • Date: Wed, 9 Jul 2008 16:45:52 -0400

> - (void) onAdd: (id) sender
> {
>    [arrayController insert:self]; // creates new object
>
>    [tableView reloadData]; // <-- make table view reload it's data
>
>    [tableView editColumn:...]; // maybe table view now knows about the new
> row?
> }

  This probably won't work as expected because the array controller
(directly after your call to -insert:) won't be ready for you. From
the docs regarding -insert: ...

"Beginning with Mac OS X v10.4 the result of this method is deferred
until the next iteration of the runloop so that the error presentation
mechanism can provide feedback as a sheet."

  Same goes for -add: ... You'll need to force the array controller to
-rearrangeObjects before asking the tableView to reload. If you're
using Core Data, you'll probably also need to force a -fetch: before
calling -rearrangeObjects, though I don't know for sure.

  This forces the array controller to do its thing right then and
there. Of course short-circuiting the mechanism like that can cause
validation problems, so be careful ...

--
I.S.
_______________________________________________

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: Making a text cell in a table editable
      • From: "I. Savant" <email@hidden>
References: 
 >Making a text cell in a table editable (From: Chris Idou <email@hidden>)
 >Re: Making a text cell in a table editable (From: Jens Miltner <email@hidden>)
 >Re: Making a text cell in a table editable (From: "Vitaly Ovchinnikov" <email@hidden>)
 >Re: Making a text cell in a table editable (From: Jens Miltner <email@hidden>)

  • Prev by Date: Re: Making a text cell in a table editable
  • Next by Date: Re: Making a text cell in a table editable
  • Previous by thread: Re: Making a text cell in a table editable
  • Next by thread: Re: Making a text cell in a table editable
  • Index(es):
    • Date
    • Thread