Re: How could I make the first row not to be edited or moved in UITableView
Re: How could I make the first row not to be edited or moved in UITableView
- Subject: Re: How could I make the first row not to be edited or moved in UITableView
- From: Jack Nutting <email@hidden>
- Date: Wed, 7 Apr 2010 15:52:35 +0200
On Tue, Apr 6, 2010 at 11:04 AM, Kalyanraju M <email@hidden> wrote:
> How could I make the first row not to be edited or moved in UITableView
>
> I know that with
> - (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath
> the first row could be set not to move but if another cell is dropped above the first one this will we moved down so is moving in the end.
>
Implement this method:
- (NSIndexPath *)tableView:(UITableView *)tableView
targetIndexPathForMoveFromRowAtIndexPath:(NSIndexPath
*)sourceIndexPath toProposedIndexPath:(NSIndexPath
*)proposedDestinationIndexPath
Make it check proposedDestinationIndexPath and if it contains a spot
you don't want to be able to drag to (like section 0, row 0), your
method should return an alternate (like section 0, row 1)
--
// jack
// http://nuthole.com
// http://learncocoa.org
_______________________________________________
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