how to give textfield on cell in iphone - iphone

I want to give textfield on tableviewcell I writen some code for that I can see textfield on cell but when i go next cell then my value is disapper and how to give on cell keyboard disapper please check this code which I writen on cell, please help me on how to disapper keyboard from cell.
I want to give textfield only at one row not at all row.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = #"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:CellIdentifier] autorelease];
}
if ([indexPath row] == 0 && [indexPath section] == 0)
{
cell.textLabel.text=#"Tags";
UITextField *textField = [[UITextField alloc] initWithFrame:CGRectMake(0, 0, 185, 30)];
cell.accessoryView = textField;
}
if ([indexPath row] == 1 && [indexPath section] == 0)
{
cell.textLabel.text=#"Notes";
cell.detailTextLabel.text=app.Notes;
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
}
}

Your value disappears when your UITableView decides to requery your cell.
Look what you do then: You create a new cell with a new UITextField which - because being new - does not include any value. Your old cell (and the value with it) is lost then.

To dismiss keyboard your class should conform UITextFieldDelegate protocol
and you should implement this method:
- (BOOL)textFieldShouldReturn:(UITextField *)txtField {
[txtField resignFirstResponder];
return YES;
}

For hiding the keyboard 'beryllium' & 'Stas' are correct. To hold the text of the textField, store the text in textFieldDidEndEditing method, like this:
- (void)textFieldDidEndEditing:(UITextField *)textField
{
nameString = textField.text;
}
In your cellForRowAtIndexPath method set the text of textField as textField.text = nameString after initializing the textField.

you can do one thing also set tag for this. and add it on cell direct without accessoryView. Use [cell addSubview:textField];to add on cell. later access it with the help of tag.

Related

Unhighlight row returns a max int on indexpath when user scrolls table with a cell highlighted

I have a UILabel as subview of my cell. When user highlight a cell the label text change it's color and when the cell is unhighlighted the color changes back, just like an usual cell textLabel.
The problem is that if the user tap a cell and scroll the table the cell will unhighlight, the unhighlight delegate method will be called but it will return [2147483647, 2147483647] as index path and the text will not change, as there is no cell on that index path.
Here is the code:
- (void)tableView:(UITableView *)tableView didHighlightRowAtIndexPath:(NSIndexPath*)indexPath{
NSInteger section = [indexPath section];
//only change the text on cells at section 1
if (section == 1) {
//get cell with given index path
UITableViewCell *currentCell = [tableView cellForRowAtIndexPath:indexPath];
// retrieve the UILabel by it's tag
UILabel *cellLabel = (UILabel *)[currentCell viewWithTag:1011];
cellLabel.textColor = [UIColor darkGrayColor];
}
}
- (void)tableView:(UITableView *)tableView didUnhighlightRowAtIndexPath:(NSIndexPath*)indexPath{
NSInteger section = [indexPath section];
if (section == 1) {
UITableViewCell *currentCell = [tableView cellForRowAtIndexPath:indexPath];
UILabel *cellLabel = (UILabel *)[currentCell viewWithTag:1011];
[cellLabel performSelector:#selector(setTextColor:) withObject:[UIColor lightGrayColor] afterDelay:0.2f];
}
}
How can i retrieve the correct cell to change it's UILabel subview text when the user scrolls table with a cell highlighted?
Testing those methods I had the same strange results for the indexPath (no idea, why these methods are not working properly).
But I would suggest to just write your own UITableViewCell subclass and override the following method (that is called every time a cell gets selected/deselected):
- (void) setSelected : (BOOL) selected animated : (BOOL) animated {
[super setSelected: selected animated: animated];
// your customisations to your UILabel
if (selected == NO) {
self.textLabel.textColor = [UIColor lightGrayColor];
}
}
Hope this answer helps you out with your problem

uitextfield of custom table cell

I am creating a table with three different types of custom cell, One of them, one custom cell is having UITextField. I create two rows using this custom cell. I set tag and delegate for textfields of both row.
My problem is, when I scroll the table, these rows with textfields move up and disappear from the screen, when scroll down, that time my app gets crash.
I get an error like
-[CellImageViewController txtField]: unrecognized selector sent to instance 0xa0ea5e0
Here is my code for cellForRowAtIndexPath:
if (indexPath.row == 0 )
{
if (cell == nil) {
cell = [[[CellWithTextFieldViewController alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID] autorelease];
}
cell.txtField.tag =1;
cell.txtField.delegate = self;
cell.txtField.text = #"kjfkd";
}
return cell;
}
else if(indexPath.row==1)
{
if (cell == nil) {
cell = [[[CellWithTextFieldViewController alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID] autorelease];
}
cell.txtField.tag = 2;
cell.txtField.text = #"glk";
cell.txtField.delegate = self;
return cell;
}
Any one have idea about this issue?
you have different type of cells, so you need to use a cellIdentifier different for each one.
Try this:
customOrNormalCell *cell [tableView dequeueReusableCellWithIdentifier:CellIdentifier]
if(!cell){
cell = [[CellWithTextFieldViewController alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:[NSString stringWithFormat:#"%i", indexPath.row]];
}
With this code, each cellIdentifier will be 1,2,3,4... (All different)
I'm pretty sure that it will solves the problem
create UITextField before create UITableView and Add your Textfield object in cell Content view
[cell.contentView addSubview:yourTxtFieldOblect];
It looks like you might be reusing a cell of a different type.
Try making sure which kind of class the cell you are reusing is before trying to access it's properties.
why you are define cell for each row?
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
NSString *CellIdentifier = [NSString stringWithFormat:#"Cell%d",indexPath.row];
CellWithTextFieldViewController *cell = (CellWithTextFieldViewController *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if(cell == nil)
{
cell =[[[CellWithTextFieldViewController alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier]autorelease];
cell.txtField.tag = indexPath.row;
cell.txtField.text = [SET TEXT FROM ARRAY];
cell.txtField.delegate = self;
}
}
I had also faced this problem in my project.
just try this:
Disabled the scrolling property in Tableview and create a scrollview.Then add your Tableview in your scrollview.
UITableView *table=[[UITableView alloc]initWithFrame:CGRectMake(0, 0, 976, 395) style:UITableViewStylePlain];
[table setSeparatorStyle:UITableViewCellSelectionStyleNone];
UIScroll *scroll=[[UIScrollView alloc]initWithFrame:CGRectMake(24, 168, 978, 395)];
[table setScrollEnabled:NO];
[scroll addSubview:table];
[self.view addSubview:scroll];
[scroll sendSubviewToBack:table];
Try this
static NSString *cellIdentifier= #"Cell";
CellWithTextFieldViewController *cell = (CellWithTextFieldViewController *)[tableView dequeueReusableCellWithIdentifier:cellIdentifier];
if (cell == nil) {
cell = [[CellWithTextFieldViewController alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier];
}
cell.txtField.tag =indexPath.row+1;
cell.txtField.delegate = self;
cell.txtField.text = #"kjfkd";
return cell;
While scrolling tableView your cell is getting reused. Thats why textField is disappearing. Try to use different cell id for different custom cells. Dont forget to give the same id in nib file for cell identifier
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *customCellOne = #"customCell1";
static NSString *customCellTwo = #"customCell2";
UITableViewCell *cell =nil;
if (0 == indexPath.row)
{
cell = (CustomCellOne *)[tableView dequeueReusableCellWithIdentifier:customCellOne];
if (nil == cell)
{
// Create custom cell one and do what ever you want
}
}
else if (1 == indexPath.row)
{
cell=(CustomCellTwo *)[tableView dequeueReusableCellWithIdentifier:customCellTwo];
if (nil == cell)
{
// Create custom cell two and do what ever you want
}
}
return cell;
}
I don't know,may be when reused the cell,the textfield delegate was released.
may be you can set the
textfield.deleagate = self;
in CellWithTextFieldViewController.m

Inserting UITextField into a TableView

I wanted to have textFields in a tableView. So I inserted them manually in the tableView in the storyboard and modified their individual properties. However, I could not see the text fields when I ran the program. I repeated the same procedure with a switch. But it still did not run. So I figured that the objects are not being shown despite the fact that they are present in the storyboard.
Q1. Any idea why this is the case?
In order to overcome this problem, I inserted these objects programmatically. For UISwitch, I added the following code in cellForRowAtindexPath right after initWithStyle:style reuseIdentifier:reuseIdentifier.
UISwitch *newSwitch = [[UISwitch alloc] initWithFrame:CGRectMake(25, 55, 77, 27)];
[newSwitch addTarget: self action: #selector(pictureSwitchAction:) forControlEvents:UIControlEventValueChanged];
[self.view addSubview:newSwitch];
This works fine. pictureSwitchAction method is called as expected.
However, when I try to do similar thing with UITextField, the app crashes. (FYI... field0 is a declared as property.) Here's my code:
field0 = [[UITextField alloc] initWithFrame:CGRectMake(0, 50, 320, 44)]; // (1)
cell = (UITableViewCell *)[field0 superview]; // (2)
[self.view addSubview:field0]; // (3)
(1) and (2) (commented (3)) crash the app. Error: *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'UITableView dataSource must return a cell from tableView:cellForRowAtIndexPath:'
My understanding is that the cell has to be return first before I can allocate some value to it. But (1) and (3) (commented (2)), yield no result. I don't know why this works for a switch and not UITextField.
Any responses to Q1 and how to insert textField programmatically?
Thanks!
Edit 1
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = #"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil)
{
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier];
}
cell.selectionStyle = UITableViewCellSelectionStyleNone; // VERY IMPORTANT
if(indexPath.section == 2)
{
if (indexPath.row == 0)
{
field0 = [[UITextField alloc] initWithFrame:CGRectMake(0, 50, 320, 44)];
cell = (UITableViewCell *)[field0 superview];
// [self.view addSubview:field0];
}
if (indexPath.row == 1)
{
field1 = [[UITextField alloc] initWithFrame:CGRectMake(0, 50, 300, 43)];
cell = (UITableViewCell *)[field1 superview];
// [self.view addSubview:field1];
}
if (indexPath.row == 2)
{
field2 = [[UITextField alloc] initWithFrame:CGRectMake(0, 50, 300, 43)];
cell = (UITableViewCell *)[field2 superview];
// [self.view addSubview:field2];
}
}
return cell;
}
Here You should make the Change in Your Code like As
Answer-1:- If you want to customize cells by simply adding additional views, you should add them to the content view .so they will be positioned appropriately as the cell transitions into and out of editing mode.
Answer-2 Crash Reason:- Because you were not returning UITableViewCell.As Crash Log ItSelf Explain The same *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'UITableView dataSource must return a cell from tableView:cellForRowAtIndexPath:'
Answer 3 -For this My understanding is that the cell has to be return first before I can allocate some value to it.Here For this Line i would say you are totally wrong simply think. can you put mango inside the basket even if you don't have that basket.means you will need that . so the same concept is here whenever you are going to add something like textfield the TableCell you need to create(allocate) that first and then you can add any object over that tableCell and finally return that tableCellAs You would see inside the CellForRowAtIndexPath method.
I think you clear now.
For The UISwitch you were adding it over the self.view means controller's view.see your code [self.view addSubview:] showing that switch over the mainView(conrtoller' view) rather Shwoing over the tableViewCell .and for the TextField it was not working because of this line cell = (UITableViewCell *)[field0 superview];it's totally wrong.
Just for your kind Information see below code.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = #"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil)
{
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier];
}
cell.selectionStyle = UITableViewCellSelectionStyleNone; // VERY IMPORTANT
if(indexPath.section == 2)
{
if (indexPath.row == 0)
{
UITextField* thisTextField =[[UITextField alloc] initWithFrame:CGRectMake(originX, originY, width ,hieght)];//pass the co-ordinate.
[thisTextField setBackgroundColor:[UIColor clearColor]];
[thisTextField setTag:indexPath.row];//here by setting this you can access further it
thisTextField.delegate= self;
[[cell contentView] addSubview:thisTextField];
// If you want to customize cells by simply adding additional views,
// you should add them to the content view .
// so they will be positioned appropriately as the cell transitions into and out of editing mode.
}
return cell;
}
I would suggest you should start from the basic of view Hierarchy and UITableView.
Thanks

how to make text field non editable at first launch of app

I want to make textfield non editable when application first time launched.
And I am having a UIBarbutton item by tapping it, it will make textfield editable.
i am trying below code but not working .
- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField{
if(edit == NO){
textField.enabled = NO;
}
if(edit == YES){
textField.enabled = NO;
}
return YES;}
You should use this method
-(Void)viewwillappers
{
[textfield setEnable:NO];
}
after click bar button set it to yes in Button Click method.
try this
-(Void)viewwillapper
{
[textfield setuserintractionEnable:yes];
}
You can use the - (void)viewWillAppear:(BOOL)animated delegate for this,
- (void)viewWillAppear:(BOOL)animated
{
[textfield setEnable:NO];
}
And write [textfield setEnable:YES]; in the bar button's click method,
- (IBAction)clicked:(id)sender
{
[textfield setEnable:YES];
}
If you use the above code, then if you navigate to another view (detailed view) and come back then also the textField will be disabled. If you don't want that, then use the following code:
- (void)viewDidLoad
{
[textfield setEnable:NO];
}
For more about the view controller delegates: UIViewController Class Reference
txtfld.userInteractionEnabled = NO;
// perform changes and enable afterwards
txtfld.userInteractionEnabled = YES;
- (UITableViewCell *)tableView:(UITableView *)tableView
cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = #"Cell";
UITableViewCell *cell = [tableView
dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc]
initWithStyle:UITableViewCellStyleValue1
reuseIdentifier:CellIdentifier]
autorelease];
}
cell.textLabel.text=[Players objectAtIndex:indexPath.row];
playername=[[UITextField alloc]initWithFrame:CGRectMake(10, 3, 280, 30)];
playername.placeholder=#"Player";
playername.delegate=self;
playername.keyboardType=UIKeyboardTypeDefault;
// playername.returnKeyType=UIReturnKeyDone;
[cell.contentView addSubview:playername];
return cell;
}
use this for dynamic textfield.
Also, if you're using Storyboard, you can simply just uncheck the "enabled" checkbox of the TextField. Should do the trick.
Simple.
in XIB , for textrField's properties, uncheck the "user interaction enabled"
.Now on the Bar button's click event use this:
[textfield setEnable:NO];
Benifits:
when you again load this view.At first that textField will be dissabled.
So it will do as you want.
- (UITableViewCell *)tableView:(UITableView *)tableView
cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *MyIdentifier = #"tblCellView";
PlayerDetailsCell *cell = (PlayerDetailsCell *)[tableView dequeueReusableCellWithIdentifier:MyIdentifier];
if(cell == nil) {
[[NSBundle mainBundle] loadNibNamed:#"PlayerDetailsCell" owner:self options:nil];
cell = tblCell;
}
return cell;
}
Use this code in your table view and call your uitableviewcell class.like I am calling(playerdetailscell)

Accessing UITextField in a custom UITableViewCell

I have a UITableViewCell (with associated UITableViewCell sub class, .m & .h) created in IB which contains a UITextField. This UITextField is connected up to an IBOutlet in the UITableViewCell sub class and also has a property. In my table view controller I am using this custom cell with the following code:
// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:#"textfieldTableCell"];
if (cell == nil) {
// Create a temporary UIViewController to instantiate the custom cell.
UIViewController *temporaryController = [[UIViewController alloc] initWithNibName:#"TextfieldTableCell" bundle:nil];
// Grab a pointer to the custom cell.
cell = (TextfieldTableCell *)temporaryController.view;
// Release the temporary UIViewController.
[temporaryController release];
}
return cell;
}
The UITextField displays fine and the keyboard pops up when clicked as expected, but how do I access (get .text property) the UITextField that each row contains? and also how do I handle the 'textFieldShouldReturn' method of the UITextFields?
I think what the OP is trying to understand is how to access the UITextField value once the user has entered data into each fields. This will not be available at the time the cells are created as suggested by #willcodejavaforfood.
I've been implementing a form and trying to make it as user friendly as possible. It is doable but be aware that it can get quite convoluted depending on the number of UITableViewCells / UITextFields you have.
Firstly to your question re: accessing the values of UITextField:
1) Make your view controller a <UITextFieldDelegate>
2) Implement the following method:
- (void) textFieldDidEndEditing:(UITextField *)textField {
NSIndexPath *indexPath = [self.tableView indexPathForCell:(CustomCell*)[[textField superview] superview]]; // this should return you your current indexPath
// From here on you can (switch) your indexPath.section or indexPath.row
// as appropriate to get the textValue and assign it to a variable, for instance:
if (indexPath.section == kMandatorySection) {
if (indexPath.row == kEmailField) self.emailFieldValue = textField.text;
if (indexPath.row == kPasswordField) self.passwordFieldValue = textField.text;
if (indexPath.row == kPasswordConfirmField) self.passwordConfirmFieldValue = textField.text;
}
else if (indexPath.section == kOptionalSection) {
if (indexPath.row == kFirstNameField) self.firstNameFieldValue = textField.text;
if (indexPath.row == kLastNameField) self.lastNameFieldValue = textField.text;
if (indexPath.row == kPostcodeField) self.postcodeFieldValue = textField.text;
}
}
I also use a similar syntax to make sure the current edited field is visible:
- (void) textFieldDidBeginEditing:(UITextField *)textField {
CustomCell *cell = (CustomCell*) [[textField superview] superview];
[self.tableView scrollToRowAtIndexPath:[self.tableView indexPathForCell:cell] atScrollPosition:UITableViewScrollPositionMiddle animated:YES];
}
And finally, you can handle textViewShouldReturn: in a similar way:
- (BOOL)textFieldShouldReturn:(UITextField *)textField {
NSIndexPath *indexPath = [self.tableView indexPathForCell:(CustomCell*)[[textField superview] superview]];
switch (indexPath.section) {
case kMandatorySection:
{
// I am testing to see if this is NOT the last field of my first section
// If not, find the next UITextField and make it firstResponder if the user
// presses ENTER on the keyboard
if (indexPath.row < kPasswordConfirmField) {
NSIndexPath *sibling = [NSIndexPath indexPathForRow:indexPath.row+1 inSection:indexPath.section];
CustomCell *cell = (CustomCell*)[self.tableView cellForRowAtIndexPath:sibling];
[cell.cellTextField becomeFirstResponder];
} else {
// In case this is my last section row, when the user presses ENTER,
// I move the focus to the first row in next section
NSIndexPath *sibling = [NSIndexPath indexPathForRow:kFirstNameField inSection:kOptionalSection];
MemberLoginCell *cell = (MemberLoginCell*)[self.memberTableView cellForRowAtIndexPath:sibling];
[cell.cellTextField becomeFirstResponder];
}
break;
}
...
}
In cellForRowAtIndexPath: include this code,
yourTextField.tag=indexPath.row+1; //(tag must be a non zero number)
Then access the textField using
UITextField *tf=(UITextField *)[yourView viewWithTag:tag];
There is even more simpler way to solve both problems,
1.Create a custom uitableviewCell class for the cell, (e.g.textfieldcell)
2.Now, in the textfieldcell.h file call textFieldDelegate
3.In the textfieldcell.m file write textFieldDelegate methods
ie
-(BOOL)textFieldShouldReturn:(UITextField *)textField;
-(void)textFieldDidEndEditing:(UITextField *)textField;
(first problem)Now, in
-(BOOL)textFieldShouldReturn:(UITextField *)textField
{
[self.mytextBox resignFirstResponder];
return YES;
}
5.(second problem),
-(void)textFieldDidEndEditing:(UITextField *)textField
{
nameTextField = mytextBox.text;
}
6.create a custom delegate method in the MaintableViewController
#protocol textFieldDelegate <NSObject>
-(void)textName:(NSString *)name;
#end
7.In MaintableViewController.m file write the implementation of the delegate method,
-(void)textName:(NSString *)name{
Nametext = name;
NSLog(#"name = %#",name);
}
8.call the delegate method in the cell class , and pass the variable in the didendmethod
9.now, assign self to cell.delegate ,when initializing the cell in uitableview
10.thats it you got the variable passed from textfield to the main view, Now do whatever u want with the variable
This is how I managed to get the text inside the UITextField inside my custom UITableViewCell in Swift. I accessed this inside my UIButton inside another custom UITableViewCell that has an #IBAction on my UITableViewController. I only have one section in my UITableViewController but that doesn't matter anyway because you can easily set and assign this yourself.
#IBAction func submitButtonTapped(sender: UIButton) {
print("Submit button tapped")
let usernameCell = self.tableView.cellForRowAtIndexPath(NSIndexPath(forRow: 0, inSection: 0)) as! UsernameTableViewCell
print("Username: \(usernameCell.usernameTextField.text)")
}
Whenever I tapped my UIButton, it gives me the updated value of the text inside my UITextField.
If you have created a class for your custom cell I'd advise you to work against it.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
MyCustomCell* cell = (MyCustomCell *) [tableView dequeueReusableCellWithIdentifier:#"BDCustomCell"];
if (cell == nil) {
// Load the top-level objects from the custom cell XIB.
NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:#"MyCustomCell" owner:self options:nil];
// Grab a pointer to the first object (presumably the custom cell, as that's all the XIB should contain).
cell = (MyCustomCell *) [topLevelObjects objectAtIndex:0];
}
// This is where you can access the properties of your custom class
cell.myCustomLabel.text = #"customText";
return cell;
}
This tutorial was helpful to me. You can reference whatever object you need through the tag.
In the Storyboard drag on a UIImageView or UITextField etc. and set the tag to 100 (whatever you want) then in your - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath use the tag to reference it.
Here's something you could do, just remember to set the tags in the storyboard:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = #"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
// Configure the cell...
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
UITextField *tField = (UITextField *)[cell viewWithTag:100];
return cell;
}