Delete buttons on tableViewCells

41 views
Skip to first unread message

stebs

unread,
Feb 10, 2010, 9:36:45 AM2/10/10
to UISpec
Hi,

Does anyone know how to touch the Delete button that appears on the
right side of a tableViewCell? I'm in an edit mode where I can touch a
red circle icon which reveals the Delete button on the cell.

Any thoughts? thanks,
Steve

Brian Knorr

unread,
Feb 10, 2010, 10:44:58 AM2/10/10
to uis...@googlegroups.com
Actually touching the "Delete" has not been solved yet (causes a crash)...it used to work pre-3.0 though, so instead we added a convenience method on a UITableView cell called delete (it calls commitEditingStyle on the table's dataSource, which is what happens when you touch the "Delete").  So you can do the following:

[[app.tableViewCell index:2] delete];

-Brian


--
You received this message because you are subscribed to the Google Groups "UISpec" group.
To post to this group, send email to uis...@googlegroups.com.
To unsubscribe from this group, send email to uispec+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/uispec?hl=en.




--
Brian Knorr
Dallas, Texas
http://www.starterstep.com

stebs

unread,
Feb 10, 2010, 11:27:22 AM2/10/10
to UISpec
Ok thanks Brian!

On Feb 10, 10:44 am, Brian Knorr <btkn...@gmail.com> wrote:
> Actually touching the "Delete" has not been solved yet (causes a crash)...it
> used to work pre-3.0 though, so instead we added a convenience method on a
> UITableView cell called delete (it calls commitEditingStyle on the table's
> dataSource, which is what happens when you touch the "Delete").  So you can
> do the following:
>
> [[app.tableViewCell index:2] delete];
>
> -Brian
>
>
>
>
>
> On Wed, Feb 10, 2010 at 8:36 AM, stebs <step...@rmsgphotography.com> wrote:
> > Hi,
>
> > Does anyone know how to touch the Delete button that appears on the
> > right side of a tableViewCell? I'm in an edit mode where I can touch a
> > red circle icon which reveals the Delete button on the cell.
>
> > Any thoughts? thanks,
> > Steve
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "UISpec" group.
> > To post to this group, send email to uis...@googlegroups.com.
> > To unsubscribe from this group, send email to

> > uispec+un...@googlegroups.com<uispec%2Bunsu...@googlegroups.com>

stebs

unread,
Feb 10, 2010, 1:48:21 PM2/10/10
to UISpec
Hey Brian, actually I can't get the delete to work. It says:
*** -[UIRedoer delete]: unrecognized selector sent to instance
0x7a3c6b0

I tried this:
[[app.tableViewCell index:0] delete];

also this:
UITableViewCell *cell = [app.tableViewCell index:0];
UIImageView *cellImage = [[cell imageView] index:1];
[cellImage touch]; //touches the cells edit icon to get into edit mode
[cell delete];

but both get the error and does not delete the row.
Any ideas? thanks
Steve

Brian Knorr

unread,
Feb 10, 2010, 2:23:49 PM2/10/10
to uis...@googlegroups.com
Looks like it's a bug when using "index"...I can reproduce it.  Please try it without the index...by default it will choose the first one.

[app.tableViewCell delete];

or if you know the text in the cell you can do:

[[[app.tableView.label text:@"Some Text in a Cell"] parent].tableViewCell delete];

To unsubscribe from this group, send email to uispec+un...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/uispec?hl=en.

stebs

unread,
Feb 10, 2010, 4:33:43 PM2/10/10
to UISpec
It works like you said without the index, thanks.

> > <uispec%2Bunsu...@googlegroups.com<uispec%252Bunsubscribe@googlegroups. com>

Reply all
Reply to author
Forward
0 new messages