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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T18:12:35+00:00 2026-06-06T18:12:35+00:00

In the application I build, I’ve created TerminalController subclass of NSPersistentDocument. In TerminalController there

  • 0

In the application I build, I’ve created TerminalController subclass of NSPersistentDocument. In TerminalController there is an outlet of NSProgressIndicator that is connected to instance of progress indicator in main window nib. The Progress Indicator that will serve determinate progress is placed in TerminalController class, because I want all my various classes to use in process of uploading or downloading data from server.

There is especially one class that is used frequently for uploading images – ImageUploader – which suppose to trigger progress indicator located in main window nib and connected to TerminalController.

My problem is I cannot seem to figure out how to access progress indicator in TerminalController from ImageUploader. I can’t create instance of ImageUploader in main window nib and connected there, as ImageUploader gets frequently initialised and released in the code.

There must be a way of accessing from any object I would think.
One of my idea was to make progress indicator global instance, but I am aware from the structure point of view is wrong and not recommended.

I would really appreciate any suggestions regarding this issue

Here is a sample of my code

TerminalController subclass of NSPersistentDocument

@interface TerminalController : NSPersistentDocument{
    IBOutlet NSProgressIndicator *loadingIndicator;
}
@property (retain, nonatomic) NSProgressIndicator *loadingIndicator;

@implementation TerminalController

@synthesize loadingIndicator;

- (void)dealloc
{
    [loadingIndicator release];
    [super dealloc];
}

ImageUploader class

@interface ImageUploader : NSObject{
    ...

    NSProgressIndicator  *progressIndictor; // This is progress indicator that should point to TerminalController progress indicator
}

@implementation CustomXMLRequests

- (void) uploadImage:(NSURL *)withUrl{
    ...

    // How to point to progress indicator that is located in TerminalController that is subclass of NSPersistentDocument
    [progressIndictor setUsesThreadedAnimation:YES];
    [progressIndictor startAnimation:self];
    [progressIndictor setMinValue:0.0];
    [progressIndictor setMaxValue:1.0];
}

- (void)connection:(NSURLConnection *)connection 
   didSendBodyData:(NSInteger)bytesWritten 
 totalBytesWritten:(NSInteger)totalBytesWritten 
totalBytesExpectedToWrite:(NSInteger)totalBytesExpectedToWrite{
    double prgrs = (double)totalBytesWritten/totalBytesExpectedToWrite;
    [progressIndictor setDoubleValue:prgrs];
    [progressIndictor displayIfNeeded];
}
  • 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-06T18:12:39+00:00Added an answer on June 6, 2026 at 6:12 pm

    If you can’t make a direct XIB connection (via IBOutlet from one view controller to the other), your next best bet is to either use “NSNotifications” to pass along a message to interested observers (i.e. from your ImageUploader to your TerminalController), or you can have your TerminalController somehow register as a delegate to your ImageUploader and then update your progress indicator that way.

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

Sidebar

Related Questions

I have a web application build on PHP that (does some processing and) displays
I have a web application build in Django + Python that interact with web
I want to compose application build version that is automatically derived from the Git
I have an application build with VS2008 SP1a (9.0.30729.4148) on Windows 7 x64 that
I have a little application I build that monitors tickets submitted. It basically just
I'm trying to build application that use single config passed by server as non
I mantain a custom PHP application (build for me) that is hosted in a
I've got an application being build by Maven that is a mixed Groovy and
How can I automate the web-application build process, that includes following steps: Change connection
from this article http://marakana.com/forums/android/examples/49.html i have seen that the application build with help 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.