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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T06:11:47+00:00 2026-06-03T06:11:47+00:00

This is my first post to StackOverflow and I am also new to Xcode

  • 0

This is my first post to StackOverflow and I am also new to Xcode and Objective-C.
I have read about delegates and I have also experimented with other peoples code. However, I wanted to see if I could create something myself that uses delegates without the aid of copying someone else’s code.

What I am trying to do, to understand delegates, is to get a UITextField delegate to update a label every time a user types a key on the keyboard.

I created a xib file and connected a TextField to a UITextField *myTextField and a Label UILabel *myLabel in my .h file.

I also added to the .h file of my ViewController Class.

However, I’m not sure what delegate method to use because the optional ones I can use as listed in the UITextFieldDelegate.h only seem to be able to update after Editing is finished. Also I’m not sure if I should put the AppDelegate method in the .h file associated with my xib or the AppDelegate.h file.

I would appreciate any help with some direction on this.

  • 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-03T06:11:48+00:00Added an answer on June 3, 2026 at 6:11 am

    So if you have a UITextField myTextField linked to your nib IB TextField object, and a UILabel myLabel linked to your nib IB Label object and you’ve made your Textfield point to your files owner then try this to see if it helps.

    I just typed this up quickly, and I didn’t test it, so check it for errors first.

    // ViewController.h
    @interface ViewController : UIViewController <UITextFieldDelegate> {
        IBOutlet UILabel *myLabel;
        IBOutlet UITextField *myTextField;
    }
    @property (nonatomic, retain) UILabel *myLabel;
    @property (nonatomic, retain) UITextField *myTextField;
    @end
    
    
    //  ViewController.m
    - (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
    {
        myLabel.text = myTextField.text;
        return YES;   
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is my first post on StackOverflow, so please be gentle... I have some
I was reading this thread/post: https://stackoverflow.com/questions/262298/windows-c-ui-technology and am also wondering about a non .NET
This is my first post in stackoverflow. I want to improve its google pagerank
this is my first post here on stackoverflow and am very impressed by the
This is my first post here. I have a problem. I need to take
This is my first post and I have to admit, I am terrible at
This is my first post to stackoverflow, so bear with me. :) I am
This is my first post on stackoverflow, so feel free let me know if
this is my first post to stackoverflow, but I've used this amazing site before.
This is my first post as a stackoverflow member. Hi, my question is how

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.