• 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: How could I make the first row not to be edited or moved in UITableView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >How could I make the first row not to be edited or moved in UITableView (From: Kalyanraju M <email@hidden>)

  • Prev by Date: Correct way to manage drag-delete cursor?
  • Next by Date: Re: multiple-page print support in NSView
  • Previous by thread: How could I make the first row not to be edited or moved in UITableView
  • Next by thread: NSPopUpButton items disabled
  • Index(es):
    • Date
    • Thread