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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T01:08:51+00:00 2026-06-01T01:08:51+00:00

I have some 10 buttons with different names each.On selecting each button I need

  • 0

I have some 10 buttons with different names each.On selecting each button I need to append the button’s title to NSTextField without removing the older string.

I have tried in the following way.

- (IBAction)nextButton:(NSButton*)sender
{
    int tag = [sender tag];

    if (tag==1) {

        [resultField setStringValue:[sender title]];
    }
    else if (tag==2) {

        [resultField setStringValue:[sender title]];
    }
    else if (tag==3) {

        [resultField setStringValue:[sender title]];
    }
    else if (tag==4) {
        [resultField setStringValue:[sender title]];
    }
    else if (tag==5) {
        [resultField setStringValue:[sender title]];
    }
    else if (tag==6) {

        [resultField setStringValue:[sender title]];
    }
    else if (tag==7) {

        [resultField setStringValue:[sender title]];
    }
    else if (tag==8) {

        [resultField setStringValue:[sender title]];
    }
    else if (tag==9) {

        [resultField setStringValue:[sender title]];
    }
    else if (tag==10) {

        [resultField setStringValue:[sender title]];
    }
}

Here resultField is my NSTextField.

setStringValue overriding the new string,so that I couldnot able to append string to NSTextField.Is there any easy way to implement this or else use NSString value to hold the previous string and set this string to NSTextFiled along with new button’s string value.

  • 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-01T01:08:53+00:00Added an answer on June 1, 2026 at 1:08 am

    How about something like:

    [resultField setStringValue: 
        [NSString stringWithFormat: @"%@ %@", [resultField stringValue], [sender title]];
    

    The idea here is that you take the original content of your NSTextField and compose a new string via stringWithFormat and then assign that new string to your NSTextField.

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

Sidebar

Related Questions

I need to show multiple buttons, but each one must have a different background
I am using jQuery to customize some radio buttons. I have two different radio
I have some buttons in an UIView. My problem is, that they get cut
I have some filter and one grid.And grid have some buttons like modify/edit.I am
In my application I have some link buttons there but when I right click
I have some useful wpf buttons to test some functionality. It would be good
I have some options for pricing using radio buttons. When a user selects the
I have some MovieClips that act like buttons, how can i do that when
I have a winform with some buttons that are updated in an event handler.
I have created an item swapper control consisting in two listboxes and some buttons

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.