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 7911639
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T13:19:23+00:00 2026-06-03T13:19:23+00:00

I am making an App in which i have a view where i am

  • 0

I am making an App in which i have a view where i am showing friends details.
So, If i need to change the details. I will have to check on the label to change it.
Here,I have set tag value for each label.

If the user presses a label the new text field will appear on the view and the user can change the Details.

So for this i have written touch began method in which i am checking the touch value…
But whenever i am touching any label i am getting the tag value of view as zero where as i should get the tag value of the label on wich i have clicked .

My code is shown below…

txtTmp = [[UITextField alloc] init];    

//txtTmp is the textfield which should appear as super view of the label where i have clicked

    txtTmp.delegate=self;

self.lblName.tag=11;

UITouch *touch = [touches anyObject]; 

//here i am getting the tag value as 0 even if i have enabled the user interaction…

NSLog(@"view.tag = %d",touch.view.tag);

if(touch.view.tag==11) {



    [txtTmp setFrame:CGRectMake(162, 43, 138, 50)];
    txtTmp.text=lblName.text;
    [self.view addSubview:txtTmp];
    [txtTmp becomeFirstResponder];
    temp=1;



}

If u have any problem regarding my question..Please get back to me….

Thanks,

  • 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-06-03T13:19:26+00:00Added an answer on June 3, 2026 at 1:19 pm

    you should enable user interaction of self.lblName.

       [self.lblName setUserInteractionEnabled:YES];
    

    Also you can check for touched label in touchesbegan method using viewWithTag message:

    UITouch *touch = [touches anyObject];
    
    if(touch.view == [self.view viewWithTag:11]) 
    {
        [txtTmp setFrame:CGRectMake(162, 43, 138, 50)];
        txtTmp.text=lblName.text;
        [self.view addSubview:txtTmp];
        [txtTmp becomeFirstResponder];
        temp=1;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am making an app in which i have to set the typeface of
I am making an app in which I have to open default audio player.
I am making an App in which i have to play music from iPod
i m making APP which do image proceesing using java SE.i want to check
I am making an app in which i need to implement calling emergency medical
I am making an app in which on one of the view I want
i am making a app which takes photo on button click i have camera.java
I am making an android app in which i have to show Hash Tag
I am making an app in which i have to use given images for
I have a three view tab bar app the second view of which I

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.