Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3984268
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T05:44:57+00:00 2026-05-20T05:44:57+00:00

I have created some tables with text fields inside, like in the contacts for

  • 0

I have created some tables with text fields inside, like in the contacts for the iphone,
(inspired from UICatalog example)

all is working, but how can I programatically read the values of this text fields, I see they have a tag, but how can I read from them (because I cannot use the IB for this as they were created programatically to go inside the tables)(noob here!)

thanks,

Im using some example hello world style where I type on the text field of the table, then click on button and the text typed goes to label,
This sample is to ultimately populate my coredata db from the table textfields
As I said im preatty noob for this so please walk me trough

so when user hit submit, I get the text to the label (and soon to coredata)

 - (IBAction) submitYourName;{
lblUserTypedName.text = txtUserName.text;
NSLog(@"received");
 }

this is the code for my textfield

- (UITextField *)textFieldNormal
 {
if (textFieldNormal == nil)
{
    CGRect frame = CGRectMake(kLeftMargin, 8.0, kTextFieldWidth, kTextFieldHeight);
    textFieldNormal = [[UITextField alloc] initWithFrame:frame];

    textFieldNormal.borderStyle = UITextBorderStyleRoundedRect;
    textFieldNormal.textColor = [UIColor blackColor];
    textFieldNormal.font = [UIFont systemFontOfSize:17.0];
    textFieldNormal.placeholder = @"<enter text>";
    textFieldNormal.backgroundColor = [UIColor whiteColor];
    textFieldNormal.autocorrectionType = UITextAutocorrectionTypeNo;    // no auto correction support

    textFieldNormal.keyboardType = UIKeyboardTypeDefault;   // use the default type input method (entire keyboard)
    textFieldNormal.returnKeyType = UIReturnKeyDone;

    textFieldNormal.clearButtonMode = UITextFieldViewModeWhileEditing;  // has a clear 'x' button to the right

    textFieldNormal.tag = kViewTag;     // tag this control so we can remove it later for recycled cells

    textFieldNormal.delegate = self;    // let us be the delegate so we know when the keyboard's "Done" button is pressed

    // Add an accessibility label that describes what the text field is for.
    [textFieldNormal setAccessibilityLabel:NSLocalizedString(@"NormalTextField", @"")];



}   
return textFieldNormal;
   }

and this to show that text field in the table cell

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
    {
UITableViewCell *cell = nil;

    static NSString *kCellTextField_ID = @"CellTextField_ID";
    cell = [tableView dequeueReusableCellWithIdentifier:kCellTextField_ID];
    if (cell == nil)
    {
        // a new cell needs to be created
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
                                       reuseIdentifier:kCellTextField_ID] autorelease];
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
    }
    else
    {
        // a cell is being recycled, remove the old edit field (if it contains one of our tagged edit fields)
        UIView *viewToCheck = nil;
        viewToCheck = [cell.contentView viewWithTag:kViewTag];
        if (viewToCheck)
            [viewToCheck removeFromSuperview];
    }

    UITextField *textField = [[self.dataSourceArray objectAtIndex: indexPath.section] valueForKey:kViewKey];
    [cell.contentView addSubview:textField];



return cell;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T05:44:58+00:00Added an answer on May 20, 2026 at 5:44 am

    @Mako take help from here
    Here appDelegate is the object of your Application Delegate class

    // Customize the appearance of table view cells.

    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
        static NSString *CellIdentifier = @"Cell";
    
        UITableViewCell *cell = [self.fieldTable dequeueReusableCellWithIdentifier:CellIdentifier];
    
             if (cell == nil) {
    
    cell = [self reuseTableViewCellWithIdentifier:CellIdentifier withIndexPath:indexPath];
                 }
    
        // Configure the cell.
    
            UITextField *txtTemp = (UITextField *)[cell.contentView viewWithTag:1];
        UITextField *txtTemp1 = (UITextField *)[cell.contentView viewWithTag:2];
        UITextField *txtTemp2 = (UITextField *)[cell.contentView viewWithTag:3];
        UITextField *txtTemp3 = (UITextField *)[cell.contentView viewWithTag:4];
    
    
    
                    switch (indexPath.section) {
                    case 0:
                            switch (indexPath.row) {
                                case 0:
    
                                    txtTemp1.placeholder = @"H/No";
                                    appDelegate.HouseNo = [NSString stringWithFormat:@"%@",txtTemp1.text];
                                    NSLog(@"%@",appDelegate.HouseNo);
                                    break;
                                    case 1:
                                    txtTemp1.placeholder = @"Street";
                                    appDelegate.street = [NSString stringWithFormat:@"%@",txtTemp1.text];
                                    NSLog(@"%@", appDelegate.street);
                                    break;
                                    case 2:
                                    txtTemp.placeholder = @"City";
                                    txtTemp2.placeholder = @"State";
                                    txtTemp3.placeholder = @"Zip Code";
                                    appDelegate.city = [NSString stringWithFormat:@"%@",txtTemp.text];
                                    NSLog(@"%@",appDelegate.city);
                                    appDelegate.state = [NSString stringWithFormat:@"%@",txtTemp2.text];
                                    NSLog(@"%@",appDelegate.state);
                                    appDelegate.zipCode = [NSString stringWithFormat:@"%@",txtTemp3.text];
                                    NSLog(@"%@",appDelegate.zipCode);
                                    break;
                                    default:
                                    break;
    
    
                                    }
                                    break;
    
    
        -(UITableViewCell *)reuseTableViewCellWithIdentifier:(NSString *)identifier withIndexPath:(NSIndexPath *)indexPath {
    
    
            CGRect cellRectangle = CGRectMake (0, 10, 300, 70); 
            CGRect Field1Frame = CGRectMake (10, 10, 290, 70);
            CGRect Field2Frame = CGRectMake (10, 10, 90, 70);
            CGRect Field3Frame = CGRectMake (110, 10, 95, 70);
            CGRect Field4Frame = CGRectMake (220, 10, 85, 70);
            UITableViewCell *cell = [[[UITableViewCell alloc] initWithFrame:cellRectangle reuseIdentifier:identifier] autorelease];
            UITextField *textField;
            UITextField *textField1;
            UITextField *textField2;
            UITextField *textField3;
    
            //Initialize Label with tag 1.
    
            textField = [[UITextField alloc] initWithFrame:Field2Frame];
            textField.tag = 1;
            [cell.contentView addSubview:textField];
    
    
    
            //Initialize Label with tag 2.
    
            textField1 = [[UITextField alloc] initWithFrame:Field1Frame];
            textField1.tag = 2;
            [cell.contentView addSubview:textField1];
    
            //Initialize Label with tag 3.
    
            textField2 = [[UITextField alloc] initWithFrame:Field3Frame];
            textField2.tag = 3;
            [cell.contentView addSubview:textField2];
    
    
            //Initialize Label with tag 4.
    
            textField3 = [[UITextField alloc] initWithFrame:Field4Frame];
            textField3.keyboardType = UIKeyboardTypeNumberPad;
            textField3.tag = 4;
            [cell.contentView addSubview:textField3];
    
    
    
    
            [textField release];
            [textField1 release];
            [textField2 release];
            [textField3 release];
            return cell;
        }
    

    Hope you understand…Good Luck!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I basically created some tables to play around with: I have Two main tables,
I have created some extra functionality on my Linq-to-SQL classes to make things easier
I have created some rounded navigation tabs using CSS and am having trouble when
I'm using SQL*Plus 9.2 on Oracle 10g enterprise. I have created some scripts that
I m new to use ankhSVN and having issues. I have created some new
I have created a .NET DLL which makes some methods COM visible. One method
I have created an application that writes some data to the root folder of
I have created an item swapper control consisting in two listboxes and some buttons
I have created a report in MS Access report and write some VBA code
I've created some MbUnit Test Fixtures that have SetUp methods marked with the SetUp

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.