views:

448

answers:

2

I am creating an application. I have to implement a bookmark feature, and adding one should be similar to this:

mmm

I want editable UITableViewCells for text input. I was wondering if there is an easier way then embedding a UITextField into a UITableViewCell. And if not, can someone explain how I can use the UITextField inside it? Thanks

+2  A: 

There isn't an easier way, you will have to subclass UITableViewCell and add in the UITextField. Here is a tutorial for using a UITextView should be about the same as a UITextField.

christo16
A: 

You can just add a textfield to the contentView of your cell, and an (X) button to the accessoryView of your cell. You could do that in a UITableView subclass which would let you add instance pointers to your custom elements.

I found this helpful: Cocoa With Love: Easy custom UITableView drawing

Like this:

cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:MyCellIdentifier] autorelease];
label = [[[UILabel alloc] initWithFrame:CGRectMake(x, y, w, h)] autorelease];
[cell.contentView addSubview:label];
zekel