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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:05:17+00:00 2026-05-26T12:05:17+00:00

In my iphone application an activity indicator is shown at the time of webservice

  • 0

In my iphone application an activity indicator is shown at the time of webservice call. My problem is that i am able to touch the view on which the activity indicator is shown.My view has textfields and buttons and i am able to enter values in the text fields and also change the button states while the activity indicator is still on it. Have anybody faced a similar situation? Does anybody know a solution to this problem? All helpful suggestions are welcomed.
Here is my activity indicator class.

ActivityProgressViewController.h

#import <UIKit/UIKit.h>

@interface ActivityProgressViewController : UIViewController {
    IBOutlet UIActivityIndicatorView *_activityIndicator;
    IBOutlet UILabel *_labelMessage;
    NSString *_messageToShow;
}

@property (nonatomic, retain) IBOutlet UIActivityIndicatorView *activityIndicator;
@property (nonatomic, retain) IBOutlet UILabel *labelMessage;

+ (ActivityProgressViewController*) createInstance;

- (void)show;
- (void)showWithMessage:(NSString*)message;
- (void)close;


+ (void)show;
+ (void)close;

@end

ActivityProgressViewController.m

#import "ActivityProgressViewController.h"

#define kACTIVITY_INDICATOR_NIB @"ActivityProgressViewController"

@implementation ActivityProgressViewController

@synthesize activityIndicator = _activityIndicator;
@synthesize labelMessage = _labelMessage;


static ActivityProgressViewController *_viewController;


- (void)didReceiveMemoryWarning {
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];
}

- (void)viewDidLoad {
    if (_messageToShow) _labelMessage.text = _messageToShow;
}

- (void)dealloc {
    [_labelMessage release];
    [_messageToShow release];
    [_activityIndicator release];
    [super dealloc];
}

+ (ActivityProgressViewController*) createInstance {
    _viewController = [[ActivityProgressViewController alloc] initWithNibName:kACTIVITY_INDICATOR_NIB bundle:nil];
    return _viewController;
}

- (void)show
{
    [_activityIndicator startAnimating];

    UIWindow *window = [[[UIApplication sharedApplication] windows]objectAtIndex:0];
    NSLog(@"[[UIApplication sharedApplication] windows]===%@",[[UIApplication sharedApplication] windows]);

    self.view.frame = CGRectMake(window.bounds.origin.x, window.bounds.origin.y, window.bounds.size.width, window.bounds.size.height);

    [window addSubview:self.view];

}



- (void)showWithMessage:(NSString*)message {
    _messageToShow = message;
    [self show];
}

- (void)close
{
    [self.view removeFromSuperview];

}

+ (void)show {
    if (!_viewController) {
        _viewController = [ActivityProgressViewController createInstance];
    }
    [_viewController show];
}

+ (void)close {
    if (_viewController) {
        [_viewController close];
    }
}

@end

Here is how i call from my required class.

 [ActivityProgressViewController show];

 [ActivityProgressViewController close];

I also call the activity indicator while exporting audio.
This is the code I use for exporting

    -(void)exportAudioFile:(AVComposition*)combinedComposition
{

[ActivityProgressViewController show];

AVAssetExportSession *exportSession = [[AVAssetExportSession alloc] initWithAsset:combinedComposition
                                                                           presetName:AVAssetExportPresetPassthrough];

    NSArray *presets =[AVAssetExportSession exportPresetsCompatibleWithAsset:combinedComposition];

    NSLog(@"presets======%@",presets);
    NSLog (@"can export: %@", exportSession.supportedFileTypes);
    NSArray *dirs = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *documentsDirectoryPath = [dirs objectAtIndex:0];
    exportPath = [documentsDirectoryPath stringByAppendingPathComponent:@"CombinedNew.m4a"];
    [[NSFileManager defaultManager] removeItemAtPath:exportPath error:nil];
    exportURL = [NSURL fileURLWithPath:exportPath];
    exportSession.outputURL = exportURL;
    exportSession.outputFileType = @"com.apple.m4a-audio";
    exportSession.shouldOptimizeForNetworkUse = YES;
    [exportSession exportAsynchronouslyWithCompletionHandler:^{
        NSLog (@"i is in your block, exportin. status is %d",
               exportSession.status);
        switch (exportSession.status) 
        {
            case AVAssetExportSessionStatusFailed: 
            {

                break;
            }
            case AVAssetExportSessionStatusCompleted: 
            {

                exportSuccess = YES;
                if (recorderFilePath) 
                {
                    NSError *finalurlError;
                    [[NSFileManager defaultManager]removeItemAtPath:recorderFilePath  error:&finalurlError];
                    finalurlError = nil;
                    [[NSFileManager defaultManager]copyItemAtPath:[exportURL path] toPath:recorderFilePath error:&finalurlError];
                    NSLog(@"finalurlError 2-----%@",finalurlError);
                }
                [ActivityProgressViewController close];
                fileUrl = [NSURL fileURLWithPath:recorderFilePath];  
                [self updatePlayerForUrl:fileUrl];
                break;
            }
            case AVAssetExportSessionStatusUnknown: 
            {   

                break;
            }
            case AVAssetExportSessionStatusExporting: 
            { 

                break;
            }
            case AVAssetExportSessionStatusCancelled: 
            { 

                break;
            }
            case AVAssetExportSessionStatusWaiting: 
            { 

                break;
            }
            default: 
            { 
                NSLog (@"didn't get export status");
                break;
            }

        };
    }];

    [exportSession release];
}
  • 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-26T12:05:18+00:00Added an answer on May 26, 2026 at 12:05 pm

    You’re adding your activity indicator to the middle of another view, yes?

    If so, you can do this in your show method:

    self.superview.userInteractionEnabled = NO;
    

    And in your close method:

    self.superview.userInteractionEnabled = YES;
    

    Here is where you’ll find information on the UIView’s userInteractionEnabled property: http://developer.apple.com/library/ios/documentation/UIKit/Reference/UIView_Class/UIView/UIView.html#//apple_ref/occ/instp/UIView/userInteractionEnabled

    Hope this helps!

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

Sidebar

Related Questions

My iPhone application has several views and some viewControllers for that views. I need
So my iPhone application currently has a tabviewcontroller that populates the entire screen. The
iPhone application, which has two buttons -right side- of Navigation Bar title. I want
I currently have an iPhone application that makes a call to an API to
I've a big problem with the iPhone application that I'm developing. When you run
My iPhone application has different view controllers and I would like to invoke them
I am making an iphone application which has user information on a web server.
I have an iPhone application that uploads images directly to S3. Then it hits
I have made an iphone application like flip cards in which values of cards
I have an iphone application in which in a button click i am showing

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.