My Blog List

Android FirstAid Coding

A Small Help From a Small Heart
Powered by Blogger.

A software professional, who still likes to code, likes to blog and loves gadgets.

Monday 29 April 2013

Showing Activity Indicator Within UIAlertview in Iphone

ViewController.h
================

@interface ViewController : UIViewController{
    UIAlertView *alertLoader;
}

@end

ViewController.m
================

- (void)viewDidLoad
{
    [super viewDidLoad];  
    [self methodtocallWebservices];
}
-(void)methodtocallWebservices{   
    alertLoader = [[UIAlertView alloc] initWithTitle:@"" message:@"Please Wait..." delegate:self cancelButtonTitle:nil otherButtonTitles:nil];
    alertLoader.tag=1;
    [alertLoader show];   
}
- (void)didPresentAlertView:(UIAlertView *)alertView
{  
    if (alertView.tag== 1) {
        UIActivityIndicatorView *indicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];       
        indicator.center = CGPointMake(alertView.bounds.size.width/2, alertView.bounds.size.height/3 * 2);       
        [indicator startAnimating];
        [alertView addSubview:indicator];       
        NSString *hostStr = @"@"http://rajuandroid.blogspot.com/api/contact_name_json";       
        NSURL *url = [[NSURL alloc] initWithString:hostStr];
        NSLog(@"login url:  %@",url);       
        NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
        [[[NSURLConnection alloc] initWithRequest:request delegate:self] autorelease];
        [url release];
    }   
}
-(void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data{
  //  [self.receivedData appendData:data];
}

-(void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error{
    [self stopLoading];
    //[self handleError:error];
}

-(void)connectionDidFinishLoading:(NSURLConnection *)connection{
    [self stopLoading];  
}
-(void)stopLoading
{
    dispatch_async(dispatch_get_main_queue(), ^{
        [alertLoader dismissWithClickedButtonIndex:0 animated:YES];
        [alertLoader release];
    });
}



33 comments:

  1. It has been simply incredibly generous with you to provide openly what exactly many individuals would’ve marketed for an eBook to end up making some cash for their end, primarily given that you could have tried it in the event you wanted.

    Devops Training in Chennai

    ReplyDelete
  2. Woah this blog is wonderful i like studying your posts. Keep up the great work! You understand, lots of persons are hunting around for this info, you could help them greatly.
    Hadoop Training in Chennai
    Hadoop Training in Bangalore
    Big data training in tambaram
    Big data training in Sholinganallur
    Big data training in annanagar
    Big data training in Velachery

    ReplyDelete
  3. Great post! I am actually getting ready to across this information, It’s very helpful for this blog.Also great with all of the valuable information you have Keep up the good work you are doing well.
    Devops Training in Chennai

    Devops Training in Bangalore

    Devops Training in pune

    Devops training in tambaram
    Devops training in velachery

    ReplyDelete
  4. I was recommended this web site by means of my cousin. I am now not certain whether this post is written through him as nobody else recognise such precise about my difficulty. You're amazing! Thank you!
    python training institute in chennai
    python training in velachery
    python training institute in chennai

    ReplyDelete
  5. Fantastic work! This is the type of information that should follow collective approximately the web. Embarrassment captivating position Google for not positioning this transmit higher! Enlarge taking place greater than and visit my web situate

    Data Science course in kalyan nagar | Data Science course in OMR
    Data Science course in chennai | Data science course in velachery
    Data science online course | Data science course in jaya nagar

    ReplyDelete
  6. Hi, Your post is quite great to view and easy way to grab the extra knowledge. Thank you for your share with us. I like to visit your site again for my future reference.
    Java Training center in Chennai
    Java Certification course in Chennai
    Java Coaching Center in Chennai
    Best Java Training in Chennai
    Best Java Training Institute in Chennai with placement
    Java J2ee Training in Chennai

    ReplyDelete
  7. This comment has been removed by the author.

    ReplyDelete
  8. Thank you for an additional great post. Exactly where else could anybody get that kind of facts in this kind of a ideal way of writing? I have a presentation next week, and I’m around the appear for this kind of data.
    Devops Training in Chennai | Devops Training Institute in Chennai

    ReplyDelete
  9. This comment has been removed by the author.

    ReplyDelete
  10. After reading your article I was amazed. I know that you explain it very well. And I hope that other readers will also experience how I feel after reading your article.

    Correlation vs Covariance

    ReplyDelete
  11. ExcelR provides data scientist course in pune. It is a great platform for those who want to learn and become a Business Analytics. Students are tutored by professionals who have a degree in a particular topic. It is a great opportunity to learn and grow.

    data scientist course in pune
    Data science course
    Data scientist course
    Data science course in pune


    ReplyDelete
  12. I am overwhelmed by your post with such a nice topic. Usually I visit your blogs and get updated through the information you include but today’s blog would be the most appreciable. Well done! data science course in surat

    ReplyDelete
  13. Here at this site is really a fastidious material collection so that everybody can enjoy a lot.
    business analytics course in hyderabad

    ReplyDelete
  14. I will truly value the essayist's decision for picking this magnificent article fitting to my matter.Here is a profound depiction about the article matter which helped me more.
    data science classes in hyderabad

    ReplyDelete
  15. This comment has been removed by the author.

    ReplyDelete