• 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
A button, an arrayController and a tableView....
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

A button, an arrayController and a tableView....


  • Subject: A button, an arrayController and a tableView....
  • From: R <email@hidden>
  • Date: Wed, 26 Oct 2011 19:02:00 -0700 (PDT)

I've got a column of buttons in a tableView.  I don't allow multiple
row selections.

A click of the button fires a method which says.....

id obj;
obj=[[anArrayController selectedObjects] objectAtIndex:0];
NSLog(@"the object: %@",obj);

If I don't pre-select the row, it takes two clicks of the button to
register the correct object.  The first click will register the
previously selected row.  It's like the button is at a higher priority
than the selected row.

To solve the problem, I did the following.....

int clickedRow=[theTableView clickedRow];
id obj=[[theTableViewArrayController
arrangedObjects]objectAtIndex:clickedRow];

This solved the problem....

But why?
_______________________________________________

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: A button, an arrayController and a tableView....
      • From: Jens Alfke <email@hidden>
  • Prev by Date: Re: NSDocument app notification of restoring windows
  • Next by Date: Re: How to create NSCursor from CGBitmap?
  • Previous by thread: Re: NSDocument app notification of restoring windows
  • Next by thread: Re: A button, an arrayController and a tableView....
  • Index(es):
    • Date
    • Thread