advertisement

Article:
  Working with Tables: Writing an Address Book Application
Subject:   Why not this?
Date:   2003-02-20 06:30:18
From:   swiftjlc
Response to: Why not this?

I finally managed to find a couple of hours to play with cocoa. Great tutorial! Thanks for getting me started quickly, and thanks to Apple (and Next) for the impressive design.


Here is an implementation using reverseObjectEnumerator, thus tempArray is no longer needed.


- (IBAction) deleteRecord:(id)sender
{
int status;
NSNumber *index;
NSArray *array = [[tableView selectedRowEnumerator] allObjects];
NSEnumerator *enumerator = [array reverseObjectEnumerator];

if ([array count] <= 0)
return;
while (index = [enumerator nextObject]) {
[records removeObjectAtIndex:[index intValue]];
[tableView deselectRow:[index intValue]];
}
[tableView reloadData];
}


1 to 1 of 1
  1. Why not this?
    2003-07-18 17:14:31  rgh [View]

1 to 1 of 1