title: NSURLConnection fails with error code -1001
body: <p>We are trying to make an iPad newspaper app for our university. Our attempt was to directly parse from newspaper's website using NSXMLParser. We were successful at parsing the headlines. What I mean is that we can parse title, summary, link, and pubDate of the articles. Our next step is to parse the body of each article so that we can retrieve couple sentences from each article to put on layout. So, we decided to make two parser classes: one for parsing headlines, other for parsing the articles from each link. As I mentioned before, we can successfully parse the headline, but in our other parser class (InnerParser.m) NSURLConnection fails with error code -1001, which means timeout. Here is URL of newpaper website</p>
  
  <p><a href="http://theaggie.org/rss/headlines.xml" rel="nofollow">http://theaggie.org/rss/headlines.xml</a></p>
  
  <p>When we tried another website, it fails with error code -1000, which mean bad link. Here is that URL</p>
  
  <p><a href="http://www.hiddenelephant.com/blog/feed/rss/" rel="nofollow">http://www.hiddenelephant.com/blog/feed/rss/</a></p>
  
  <p>I know there are definitely something wrong in our code, but we couldn't figure it out. This is my first posting on stackoverflow. I don't know how much code I should post. I will include some code and logs from console. If those are not enough, I am willing to show our whole code to those who can be generous enough to share their knowledge with us. Any help will be greatly appreciated. Thank you all in advance.</p>
  
  <p>Here is a code where we are getting error</p>
  
  <pre><code>- (void)parseRssFeed:(NSString *)url withDelegate:(id)aDelegate {
  [self setDelegate:aDelegate];
  
  NSLog(@"*****************************************************************************************");
  NSLog(@"Inner parser link:%@", url);
  NSLog(@"*****************************************************************************************");
  
  storyData = [[NSMutableData data] retain];
  
  NSURL *baseURL = [[NSURL URLWithString:url] retain];
  
  NSLog(@"Step 1: What about Here!");
  
  NSURLRequest *request = [NSURLRequest requestWithURL:baseURL];
  
  NSLog(@"Step 2: What about Here!");
  
  [[[NSURLConnection alloc] initWithRequest:request delegate:self] autorelease];
  
  NSLog(@"Step 3: What about Here!");
  
  }
  
  - (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response
  {
  NSLog(@"Did Recieve Response!?");
  [storyData setLength:0];
  }
  
  - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data
  {
  NSLog(@"Did Recieve Data!?");
  [storyData appendData:data];
  }
  
  - (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error
  {
  NSString * errorString = [NSString stringWithFormat:@"Unable to download xml data (Error code %i )", [error code]];
  
  UIAlertView * errorAlert = [[UIAlertView alloc] initWithTitle:@"Error loading content" message:errorString delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
  [errorAlert show];
  }
  
  - (void)connectionDidFinishLoading:(NSURLConnection *)connection
  {
  
  NSLog(@"Did Finish Loading!?");
  
  self.news = [[Story alloc] init];
  
  NSXMLParser *storyParser = [[NSXMLParser alloc] initWithData:storyData];//story source code now contained in storyData
  
  [storyParser setDelegate:self];    // May need to change the name of rssParser to something else
  
  [storyParser parse];
  
  }
  </code></pre>
  
  <p>And here are some logs from console</p>
  
  <pre><code>2011-04-08 20:34:51.936 TheCalAggie[794:207] Parsing started for article!
  2011-04-08 20:34:51.938 TheCalAggie[794:207] Adding story title: Aggie Daily Calendar
  2011-04-08 20:34:51.938 TheCalAggie[794:207] From the link: http://theaggie.org/article/2011/04/07/aggie-daily-calendar
  2011-04-08 20:34:51.939 TheCalAggie[794:207] Summary: TODAY: Challah For Hunger; Shinkoskey Noon Concert: Zoila Muñoz; Student Services and Fees Administrative Advisory Committee
  2011-04-08 20:34:51.940 TheCalAggie[794:207] Published on: Thu, 07 Apr 2011 00:00:00 -0700
  2011-04-08 20:34:51.941 TheCalAggie[794:207] ======================
  2011-04-08 20:34:51.942 TheCalAggie[794:207] STARTING STORY PARSER!
  2011-04-08 20:34:51.942 TheCalAggie[794:207] ======================
  2011-04-08 20:34:51.943 TheCalAggie[794:207] Parsing started for article!
  2011-04-08 20:34:51.944 TheCalAggie[794:207] Adding story title: Becoming an undergraduate researcher 
  2011-04-08 20:34:51.945 TheCalAggie[794:207] From the link: http://theaggie.org/article/2011/04/07/becoming-an-undergraduate-researcher
  2011-04-08 20:34:51.946 TheCalAggie[794:207] Summary: Researching as an undergraduate can provide opportunities for those pursuing post-graduate study and experience working in a specific field.
  2011-04-08 20:34:51.946 TheCalAggie[794:207] Published on: Thu, 07 Apr 2011 00:00:00 -0700
  2011-04-08 20:34:51.947 TheCalAggie[794:207] ======================
  2011-04-08 20:34:51.948 TheCalAggie[794:207] STARTING STORY PARSER!
  2011-04-08 20:34:51.949 TheCalAggie[794:207] ======================
  2011-04-08 20:34:51.950 TheCalAggie[794:207] Parsing started for article!
  2011-04-08 20:34:51.951 TheCalAggie[794:207] Adding story title: Aggie Daily Calendar
  2011-04-08 20:34:51.952 TheCalAggie[794:207] From the link: http://theaggie.org/article/2011/04/06/aggie-daily-calendar
  2011-04-08 20:34:51.953 TheCalAggie[794:207] Summary: Veggie Bed Prep Workshop; French Club Meeting; Third Street Improvements Final Community Workshop; Delta Epsilon Mu Games Night; The Spokes Auditions; Bistro 33 Poetry Night Reading Series.
  2011-04-08 20:34:51.954 TheCalAggie[794:207] Published on: Wed, 06 Apr 2011 00:00:00 -0700
  2011-04-08 20:34:51.955 TheCalAggie[794:207] ======================
  2011-04-08 20:34:51.956 TheCalAggie[794:207] STARTING STORY PARSER!
  2011-04-08 20:34:51.957 TheCalAggie[794:207] ======================
  2011-04-08 20:34:51.957 TheCalAggie[794:207] We recieved the article!
  2011-04-08 20:34:51.958 TheCalAggie[794:207] Article: *nil description*
  2011-04-08 20:34:51.959 TheCalAggie[794:207] What is in sections: (
  (null)
  )
  2011-04-08 20:34:51.963 TheCalAggie[794:207] *****************************************************************************************
  2011-04-08 20:34:51.965 TheCalAggie[794:207] Inner parser link:http://theaggie.org/article/2011/04/07/federal-government-cites-uc-davis-for-animal-cruelty
  2011-04-08 20:34:51.966 TheCalAggie[794:207] *****************************************************************************************
  2011-04-08 20:34:51.966 TheCalAggie[794:207] Step 1: What about Here!
  2011-04-08 20:34:51.967 TheCalAggie[794:207] Step 2: What about Here!
  2011-04-08 20:34:51.968 TheCalAggie[794:207] Step 3: What about Here!
  2011-04-08 20:34:51.976 TheCalAggie[794:207] Parsing is done Parser class!
  </code></pre>