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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T05:24:34+00:00 2026-05-21T05:24:34+00:00

I made a .xib with a button, and referenced it with an outlet to

  • 0

I made a .xib with a button, and referenced it with an outlet to “btnActies”

when i do the following (at any given time) in the back-end C# code

btnActies.TitleLabel.Text = “This is a
new label!”;

When i build and run the app, the label on the button changes to “This is a new label”,
but then, if I touch the button, the label reverts to the ‘default’ text i set in the .xib file.

How do i change the label on a Monotouch UIButton and keep this from happening?

  • 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-21T05:24:35+00:00Added an answer on May 21, 2026 at 5:24 am

    When you want to set some text on a UIButton, you do not do it by altering the text of its TextLabel property. You do it by calling its SetTitle method, passing as the second argument, the button state for which the title will be set at runtime. Chetan Bhalara’s answer is correct, here is the C#/MonoTouch equivalent:

    btnActies.SetTitle ("title", UIControlState.Normal);
    

    They way you are doing it right now doesn’t work, because the label’s text is changing internally whenever needed, to the title set in Interface Builder (if you have set it), in this case when you tap the button.

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

Sidebar

Related Questions

I have a test app for iOS that is built without any nib/xib files.
So I made my iPhone app universal, it created a new mainWindow xib file
I made my first serious iPad app with Xcode3. It is a pretty simple
Here is how I made a universal app from an existing iPhone project by
So here's a weird one. I've been doing a combination of interface builder and
I don't know what could be causing this. I chose View Based Application. I
How do I restart cocos2d scene and clean memory after the previous one? [director
I want to hide keyboard when a user presses return in UITextView object in
I'm far far down the road of having built all my nice buttons and
I'm having some trouble here. I've got a tableview, with 7 cells, all of

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.