• 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: Select tablecell on creation through arrayController
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Select tablecell on creation through arrayController


  • Subject: Re: Select tablecell on creation through arrayController
  • From: Quincey Morris <email@hidden>
  • Date: Wed, 25 Feb 2009 23:11:08 -0800

On Feb 25, 2009, at 19:12, Walker Argendeli wrote:

The code is now this, which works- kindof:

[notebookController add:sender];
[notebookTableView editColumn:0 row:[notebookTableView selectedRow] withEvent:nil select:YES];


Only problem is, for the second line, I actually have to kick off a timer...:
[NSTimer scheduledTimerWithTimeInterval:.01
target:self
selector:@selector(beginTextFieldCellEdit)
userInfo:nil
repeats:NO];
...that calls the second line from the first snippet in beginTextFieldCellEdit.
Anybody know what's going on here?

I assume notebookController is a kind of NSArrayController. The class reference has this to say about the 'add:' method:


"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."

So you can't do the second line right away. A NSTimer is one solution, but a more direct approach would be to replace the second line with:

[self performSelector: @selector(beginTextFieldCellEdit) withObject: nil afterDelay: 0];


_______________________________________________

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: 
 >Select tablecell on creation through arrayController (From: Walker Argendeli <email@hidden>)
 >Re: Select tablecell on creation through arrayController (From: Walker Argendeli <email@hidden>)

  • Prev by Date: is NSDictionaryController the solution to my problem ?
  • Next by Date: RE: Populating a new SQLite Core Data store with default data
  • Previous by thread: Re: Select tablecell on creation through arrayController
  • Next by thread: Re NSTableView Cell edit values.
  • Index(es):
    • Date
    • Thread