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

  • Home
  • SEARCH
  • 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 6705959
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:27:51+00:00 2026-05-26T07:27:51+00:00

i am doing sample application where i am creating two TextField programitically i.e,Textfield1 and

  • 0

i am doing sample application where i am creating two TextField programitically i.e,Textfield1 and Textfield2 and Having one Button which is Dragged on UI.

Now My requirement is I have two textfield created manually and a Button, When i click a button it should access the value entered in both textfield and display its value on console using NSLog.

so can anyone suggest me how to do it?As textifeild is created programmitically it is not having IBOutlet. so i want to read textfield value when i click button and display on Console.so please suggest me with sample code

{
[self Textfiled1];
[Self TextField2];

}

-(void)textField1

{

UITextField *textField = [[UITextField alloc] initWithFrame:CGRectMake(200, 250, 200, 35)];
textField.returnKeyType = UIReturnKeyDone;
textField.adjustsFontSizeToFitWidth = TRUE;
[textField addTarget:self 
              action:@selector(textFieldDone:) 
    forControlEvents:UIControlEventEditingDidEndOnExit];     
[self.view addSubview:textField];
[textField release]; 

}

Same as above for Textfield2.

  • 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-26T07:27:52+00:00Added an answer on May 26, 2026 at 7:27 am

    Set tag for both the UITextField.

    UITextField *textField = [[UITextField alloc] initWithFrame:CGRectMake(200, 250, 200, 35)];
    textField.returnKeyType = UIReturnKeyDone;
    textField.tag = 1;
    ...
    

    for the second,

    UITextField *textField = [[UITextField alloc] initWithFrame:CGRectMake(200, 250, 200, 35)];
    textField.returnKeyType = UIReturnKeyDone;
    textField.tag = 2;
    ...
    

    In Button click action method,

    UITextField *textField = (UITextField*)[self.view viewWithTag:1];
    NSString *text1 = textField.text;
    

    Similarly for the next UITextField.

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

Sidebar

Related Questions

I am creating an android application in which there are two activites. One activity
I am creating a simple application with Django. I realized that I am doing
I am very new to grails.I am doing one sample project for image uploading
In my sample application, I have basically two threads. The main thread contains a
I am doing sample application using windows mobile 5.0. When I receive an SMS,
I am creating a chat application the interacts between two users. I want to
When creating an application which needs to be capable of displaying a range of
i am doing application where i have taken two views Portrait and Landscape. i
I am currently writing a .Net application in c#, which has two main components:
I am designing a web application which will be doing three things: 1) store

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.