Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>What happens is that UITableView loads only the visible cells, and all the time that the UITableView is scrolled, the callback <code>cellForRowAtIndexPath:</code> is called. But let me get this straight. Why do you need a UITableView to make a form? And as I can see, you are loading one cell per section... And, you are only initializing the cell. What you should do. Subclass UITableViewCell and create your objects there. </p> <p>then call like this:</p> <pre><code>cell = [[[MyCustomCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:cellIdentifierF] autorelease]; </code></pre> <p>Then you can call exactly the controller you want. And you have to control the behavior of your UITableView whenever it is scrolled. like this:</p> <pre><code>case 7: { if (cell == nil) { cell = [[[MyCustomCellEigth alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:cellIdentifierF] autorelease]; cell.backgroundColor = [[UIColor alloc]initWithPatternImage:[UIImage imageNamed:@"buttonbg-1.png"]]; /*this should be done in the Custom Cell init method if([cellIdentifierF isEqualToString: eightCellIdentifier]) { textField.tag = 107; textField.inputView = self.groupPicker; tagValues = textField.tag; textField.text = reminderInstance.remGroup; NSLog(@"Value = %@",textField.text); [cell.contentView addSubview:textField]; [self.fields addObject:textField]; } */ } else { //Control content ((MyCustomCell*)cell).myTextField.text = @"SOME TEXT"; } } break; </code></pre> <p>About the picker. It probably only works once you have scrolled all table, because it references a textField that will only be added to the Array once the correspondent cell become visible. </p> <p>There isn't much more to do. But follow this and you should be fine. First, Subclass UITableViewCell. You can create the controls yourself programmatically or with a xib. This will give you more control over the cells itself. About the picker, instead of creating a array with controls, create it with the values it should have. Once someone has typed something, save it using the UITextFieldDelegate. Hope it helps.</p> <p>EDIT:</p> <p>You must create a Subclass of the UITableViewCell. On Xcode, create a new file. Select objective-c Class. On the next screen, on the field subclass of, select UITableViewCell and name your cell accordingly. This will create a class that will override the <code>initWithStyle:reuseIdentifier:</code> method. Inside this method, you should put your init code.</p> <p>like this:</p> <pre><code>#import &lt;UIKit/UIKit.h&gt; @interface MyCustomCellOne : UITableViewCell { UITextField *textField; } @end #import "MyCustomCellOne.h" @implementation MyCustomCellOne - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; if (self) { // Initialization code textField = [[UITextField alloc] initWithFrame:"YOUR FRAME"]; textField.tag = 107; textField.text = @"SOME TEXT"; [self addSubview:textField]; } return self; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload