• 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: newbie question on 'Cocoa Programming for Mac OS X'
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: newbie question on 'Cocoa Programming for Mac OS X'


  • Subject: Re: newbie question on 'Cocoa Programming for Mac OS X'
  • From: Tony Cate <email@hidden>
  • Date: Thu, 07 Feb 2002 22:25:22 -0600

On 2/7/02 6:55 PM, "Jon B. Williams" <email@hidden> wrote:

> I solved the problem by reversing the order of the items in the
> enumerator, so that you have a list of indices running from largest to
> smallest, instead of smallest to largest

Another approach:

row = [tableView selectedRow];
if (row > -1) // Ensure a row is selected.
{
if (![tableView isRowSelected:(row + 1)])
// we're at the top of the selection
row -= ([tableView numberOfSelectedRows] - 1);
// select the bottom row.

while ((object = [enumerator nextObject]))
{
[employees removeObjectAtIndex: row];
}
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: newbie question on 'Cocoa Programming for Mac OS X' (From: "Jon B. Williams" <email@hidden>)

  • Prev by Date: Re: Disable the drag snap-back?
  • Next by Date: Memory Mania Revisted
  • Previous by thread: Re: newbie question on 'Cocoa Programming for Mac OS X'
  • Next by thread: RE: newbie question on 'Cocoa Programming for Mac OS X'
  • Index(es):
    • Date
    • Thread