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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T15:56:29+00:00 2026-06-09T15:56:29+00:00

I apologize if my terminology isn’t correct – I’ve been learning Objective C for

  • 0

I apologize if my terminology isn’t correct – I’ve been learning Objective C for just a few days, so I’m still a little unfamiliar.

I have a ViewController that has a progress bar (UIProgressView) hooked up with an IBOutlet using Xcode’s storyboard “quick drag” functionality. The ViewController instantiates an object of a custom class I have written. It passes a message to a selector of that object that does a lengthy bit of work which takes about 15-20 seconds. I want to be able to update the progress bar as the job progresses, but I can’t work out how to access the calling class’s UIProgressView to do this. I don’t need to use a timer, as the object’s method runs a long loop which I know the limits of, and can update the progress bar based on current position in the loop.

I’m sure it’s a pretty fundamental concept in objective C programming, but a prod towards the right direction or documentation would really help me out.

  • 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-09T15:56:30+00:00Added an answer on June 9, 2026 at 3:56 pm

    Use the delegate pattern.

    Create a protocol for your ProgressBar updates:

    @protocol MyProgressBarDelegate
    
    - (void) onUpdateProgress:(NSInteger)progress;
    
    @end
    

    Your ViewController implements the delegate and contains this onUpdateProgress method.

    Your custom class has a delegate variable which you set in its initializer, its set to the ViewController instance.

    id <MyProgressBarDelegate> delegate;
    

    Update your CustomClass designated initializer to pass delegate:(id)delegate as a parameter.

    - (void) initWithDelegate:(id<MyProgressBarDelegate>)delegate
    {
        self.delegate = delegate;
    }
    

    When initializing your CustomClass, [[CustomClass alloc] initWithDelegate:self];

    OR make delegate a settable @property, and update via [mCustomClass setDelegate:self];

    Then you can call the onUpdateProgress method from your custom class.

    if (delegate != nil)     
     [delegate onUpdateProgress:int];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I apologize if I use the incorrect terminology here, I've only been using emacs
Apologize if this particular problem has been answered already (a search didn't turn anything
I apologise if if 'hover assist' isn't the right terminology but I'm referring to
I apologize if the terminology is incorrect - not sure whether to call it
I apologize in advance if the terminology in my question is incorrect. I want
I'm not sure of the terminology so I apologize ahead of time. I'm trying
I'm new to programming and apologize up front if I misuse terminology. In a
I apologize in advance for some confusion over the terminology. I get a bit
I'm new to git so I apologize (and please correct me) if I misuse
I am new to programming and very new to objective c so I apologize

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.