Re: Moving records in NSTableView
Re: Moving records in NSTableView
- Subject: Re: Moving records in NSTableView
- From: "Peter Karlsson" <email@hidden>
- Date: Fri, 30 May 2003 12:31:40 +0000
I just found a nice function called exchangeObjectAtIndex, I think this will
solve my problem. If I move a record down I just exchange it with the record
under the current like this:
[myMutableArray exchangeObjectAtIndex:[myOutlet selectedRow]
withObjectAtIndex:[myOutlet selectedRow]+1];
No need to copy, remove and insert a record any longer, I love Cocoa :-)
Peter
From: "Peter Karlsson" <email@hidden>
To: email@hidden
Subject: Moving records in NSTableView
Date: Fri, 30 May 2003 11:43:30 +0000
Dear list!
I have a NSTableView with a couple of records. I want to move the selected
record up or down when I click my 2 buttons. So far I have used this
method:
1 - Copy the selected record
2 - Delete the selected record
3 - Insert the copy'ed record at a new index
Are there any simpler way, for example: a built in fuction that moves a
record up or down?
Peter
_________________________________________________________________
The new MSN 8: advanced junk mail protection and 2 months FREE*
http://join.msn.com/?page=features/junkmail
_______________________________________________
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.
_________________________________________________________________
Tired of spam? Get advanced junk mail protection with MSN 8.
http://join.msn.com/?page=features/junkmail
_______________________________________________
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.