Need help with UITableView Edit Mode event handling

Discussion in 'iOS Programming' started by pwturben, Mar 17, 2010.

  1. pwturben macrumors newbie

    Jan 27, 2010

    my problem:

    I have and UITableView. This table have some rows.
    I wanted to implement deleting rows usin this method:

    At first, i have and "edit" button on the left of UINavigation bar.
    I have a method connected to this button, he has a string:
    (ComplaintsTable - its my UITableView)

    [ComplaintsTable setEditing:YES animated:YES];

    when im pressing "Edit" button, starts standart animation, and (-) red icons appeared. All is ok.

    Notice, that i have label with "Yesterday" text. < its date

    Then, when im pressing (-) button - its become (|) button, and "Delete" button appears:

    look - my Yesterday label is under "Delete" button. I need to hide that.
    Of course i cant make it smaller and hide under delete, coz there will be any text of any size and any length.

    My problem is.
    Im trying to Hide this label with text "Yesterday"

    I want to hide this label when i press (-) button.
    How can i handle event, when (-) - red button in some cell is pressed ?


    p.s.:its like a standart mechanism in "SMS" or other. Hiding date when u are editing some row.
  2. PhoneyDeveloper macrumors 68040


    Sep 2, 2008
    The table will automatically resize your cell when the delete button appears. You need to set the autoResizingMask for the label. I have one that's like this and seems to work

    label.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleWidth;
  3. pwturben thread starter macrumors newbie

    Jan 27, 2010
    yeah. Some magic with label width, and with the bit mask of AutoResising mask and all works great!

    Thanks. Hope its a good implementation. But who can judge winners?label is hidden!:D

Share This Page