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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T06:29:02+00:00 2026-06-17T06:29:02+00:00

I put UIButton on UIVIewController by StoryBoard. in xxxVIewController.h @interface xxxViewController : UIViewController{ IBOutlet

  • 0

I put UIButton on UIVIewController by StoryBoard.

in xxxVIewController.h

@interface xxxViewController : UIViewController{

IBOutlet UIButton *But;
}
@property (retain, nonatomic) IBOutlet UIButton *But;

I would like to access “*But” from another class to change setimage of UIButton.

I think if I can get the instance of UIViewController,it is solved…..

Does anyone give me the hint


thanks He-Was ,Jasper Blues I added comments .

One is xxxViewController which doesn’t contain navigation controller.
it contains only four buttons.

The other is TimerClass (NSObject)
which manage the time of application.

TimerClass class has timer.
What I want to do is
changing the button color on xxxViewController every a few seconds from TimerClass.

I can access TimerClass method easily.
because xxxViewController has TimerClass instance.

But xxxViewController was made by automatic,so I am not sure how to get xxxViewController instance from TimerClass.

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

    I would setup xxxVIewController as a delegate for TimerClass and when you create your TimerClass instance, set the delegate to self.

    ie:

    self.timer = [[TimerClass alloc] init];
    self.timer.delegate = self;  // This assumes that you have already created a declared property called delegate in your `TimerClass` class
    

    Then, when it is time to update the button, you should call a delegate function in xxxVIewController and have it update its own button:

    // Or whatever method that you want called
    if (self.delegate respondsToSelector(@selector(changeButtonColor)))
    {
        [self.delegate changeButtonColor];
    }
    

    Read up on protocols if you aren’t familiar and you will see a good way to implement this in a more general fashion.

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

Sidebar

Related Questions

while i create my UIButton on Interface builder, i put a text like Button
I am trying to put a custom UIButton on a custom UIView but the
Anywhere there is a UIButton in my app i would like it to have
I'd like to put in an UIButton in the center of the navigation bar.
I thought to be clever and just put an transparent UIButton over an UIImageView
Put simply, I want to select all data in two columns from each of
I put a TileGroup in a BorderContainer and set the width to 100%, but
I've got a UIButton that I create at runtime. I put a title on
I have a custom button, subclassed from UIButton that is initialised as below (obviously
I have one UIButton . I put one image on that. When I click

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.