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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T16:17:31+00:00 2026-05-17T16:17:31+00:00

I am running Objective-C/Cocoa in Shell in Windows, not on Mac OS X. I

  • 0

I am running Objective-C/Cocoa in Shell in Windows, not on Mac OS X.

I want to append a string with an existing string in a text field when I click a button. I’ve created a button in a window, but I don’t know how to append a string when I click that button.

How can I append a string to a text field when that button is clicked?

  • 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-17T16:17:31+00:00Added an answer on May 17, 2026 at 4:17 pm
    import <UIKit/UiKit.h>
    @interface MyViewController : UIViewController {
        UIButton *btnToAppend;
        UITextField *textfield;
    }
    
    - (IBAction)buttonClick:(id)sender;
    
    @end
    
    import "MyViewController.h"
    
    @implementation MyViewController
    
    -(void)init{
        btnToAppend = [UIButton buttonWithType:UIButtonTypeRoundedRect];
        btbToAppend.frame = CGRectMake(10, 10, 100, 30);
        [btnToAppend setText:@"Append Text" forState:UIControlStateNormal];
        [btnToAppend addTarget:self action:@select(buttonClick:) forControlEvents:UIControlEventTouchUpInside];
        [self.view addSubView:btnToAppend];
        textfield = [[UITextField alloc] initWithFrame:CGRectMake(10, 200, 300, 50)];
        textfield.borderStyle = UITextBorderStyleRoundedRect;
        [self.view addSubView:textfield];
    }
    
    -(IBAction)buttonClick:(id)sender {
        NSString *string = [textfield.text stringByAppendingString:@"Welcome "];
        textfield.text = string;
    }
    
    - (void)dealloc {
        [super dealloc];
    }
    
    @end
    

    Output will be like :

    Welcome Welcome Welcome …

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

Sidebar

Related Questions

I am using GNU GCC compiler(XCODE NOT AVAILABLE) for running objective C .I want
I'm trying to create a Cocoa Objective-C program on my Snow Leopard MacBook running
I'm trying to follow Cocoa and Objective C: Up and Running by OReilly (a
Using CoreGraphics in a cocoa objective-c program running under Lion, I'd like to move
I read in Cocoa and Objective C: Up and Running that -copy will always
Is there a way to get the list of currently running threads in objective-C?
I am fairly new to Objective-C and whilst running the Clang static analyser this
I'm relatively new to Objective-C + Quartz and am running into what is probably
I'm fairly new to Cocoa and Objective-C. Currently I'm developing a fairly basic application
I'd like to use a C++ stack type in Objective-C, but I'm running into

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.