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

  • Home
  • SEARCH
  • 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 6944515
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:19:00+00:00 2026-05-27T13:19:00+00:00

I’ve been pulling my hair out a bit over this. I’m creating a very

  • 0

I’ve been pulling my hair out a bit over this. I’m creating a very simple app, it simply downloads an rss feed and displays it in a UITableview, which is inside a UINavigationController. Whilst it’s downloading the feed I’m presenting a Modal View.

In my modal view I’m displaying a UIImageView and a UIActivityIndicatorView that is set to spin. I’m using ASIHTTRequest to asynchronously grab the feed and then using the either the completion block to get the response string and stop the spinner or the failure block to get the NSError and display a alert View. This all works perfectly.

I’ve then created a protocol to dismiss the modal view from the tableview which is called inside the completion block. But the modal view is never dismissed! I’ve tried pushing it into the navigation controller but exactly the same problem occurs. I even have tried setting the modal view delegate to nil but still no luck.

I’ve checked it without blocks using the ASIHTTPRequest delegate methods and it’s the same, and if I don’t present the modal view the table view is displayed normally.

Any Ideas? I’ve skipped out all the tableview delegate and datasource methods as well as the dealloc and any unused functions.

@interface MainTableViewController () 
-(void)loadModalView;
@end


@implementation MainTableViewController
@synthesize tableView;
@synthesize modalView;

// Implement loadView to create a view hierarchy programmatically, without using a nib.
- (void)loadView
{

   [super loadView];
tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, self.view.bounds.size.width, self.view.bounds.size.height) style:UITableViewStylePlain];
tableView.delegate = self;
tableView.dataSource = self;
[self.view addSubview:tableView];

   [self loadModalView];


}

-(void)loadModalView
{
    modalView = [[ModalViewController alloc]init];
    modalView.delegate = self;
    [self presentModalViewController:modalView animated:NO];

}


//Modal View Delegate
-(void)downloadComplete
{
modalView.delegate = nil;
[self dismissModalViewControllerAnimated:NO];



}


@end 


@interface ModalViewController ()


- (void)loadView
{
[super loadView];

backgroundImage = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 320, 460)];

[self.view addSubview:backgroundImage];

spinner = [[UIActivityIndicatorView alloc]initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
spinner.frame = CGRectMake(160, 240, spinner.bounds.size.width, spinner.bounds.size.height);
spinner.hidesWhenStopped = YES;
[self.view addSubview:spinner];
[spinner startAnimating];


NSString* urlString = FEED_URL;
NSURL* url = [NSURL URLWithString:urlString];

ASIHTTPRequest* request = [ASIHTTPRequest requestWithURL:url];
[request setCompletionBlock:^{
    // Use when fetching text data
    NSString *responseString = [request responseString];
    [spinner stopAnimating];
    [delegate downloadComplete];
    // Use when fetching binary data

}];
[request setFailedBlock:^{
    NSError *error = [request error];
    UIAlertView* alert = [[UIAlertView alloc]initWithTitle:@"Error" message:error.description delegate:self cancelButtonTitle:@"Continute" otherButtonTitles: nil];
    [alert show];
    [alert release];
}];
[request startAsynchronous];



}

Matt

  • 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-27T13:19:01+00:00Added an answer on May 27, 2026 at 1:19 pm

    The only way I solved this error was to synchronously download the data and push and pop the download view onto the navigation stack. Not ideal but it works.

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

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
this is what i have right now Drawing an RSS feed into the php,
I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
Seemingly simple, but I cannot find anything relevant on the web. What is the
We're building an app, our first using Rails 3, and we're having to build
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
Does anyone know how can I replace this 2 symbol below from the string

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.