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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T15:52:12+00:00 2026-05-15T15:52:12+00:00

I have an app which got 4 TableViewController which each make an instance of

  • 0

I have an app which got 4 TableViewController which each make an instance of an RSSParser and have a function called commonInit which starts the parsing.
Inititally i called the commonInit from the default init function in the TableViewController and it works fine but in case of no internet access I would get 4 alert windows which is kinda bad mojo.
So instead I wanted to do a reachability check in the appdelegate and then notify each TableViewController and start the parser. The reachability check is launched in a seperat thread in order to avoid stall if DNS problems etc.

But when I run the app the parsers gets called fine but they never receive any data back.
In my parser i have followed the apple example of NSURLConnection for async download of feeds.

So in my appdelegate I have:

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
 ....
 // Reachability setup, a new thread is created to make it async to avoid possible stall.
 [NSThread detachNewThreadSelector:@selector(checkConnection) toTarget:self withObject: nil];
 ...
 return YES;}

and after this i have:

    -(void)checkConnection{
 //Test for Internet Connection
 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; 

 Reachability *r = [Reachability reachabilityWithHostName:@"www.somehostname.com"];
 NetworkStatus internetStatus = [r currentReachabilityStatus];
 if ((internetStatus != ReachableViaWiFi) && (internetStatus != ReachableViaWWAN)) {
  UIAlertView * errorAlert = [[UIAlertView alloc] initWithTitle:@"Missing Internet" message:@"Can not connect to the internet at the moment." delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
  [errorAlert show];
 } else {
  [[NSNotificationCenter defaultCenter] postNotificationName:@"activation" object:nil];
 }
 [pool release];}

and as you can see I make the following notification if there is a connection:

[[NSNotificationCenter defaultCenter] postNotificationName:@"activation" object:nil];

Hope you guys can help me.

  • 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-15T15:52:13+00:00Added an answer on May 15, 2026 at 3:52 pm

    I think you should post the notification on the main thread.

    This is easy with Grand Central Dispatch. It’s a bit harder with the old API.

    I propose creating a new method:

    - (void)postNotification:(NSDictionary *)userInfo {
      NSString *notificationName = [userInfo objectForKey:@"name"];
      [[NSNotificationCenter defaultCenter] postNotificationName:notificationName object:nil];
    }
    

    And then replace the line where you are posting the notification now with:

    NSDictionary *userInfo = [NSDictionary dictionaryWithObject:@"activation" forKey:@"name"];
    [self performSelectorOnMainThread:@selector(postNotification:) withObject:userInfo waitUntilDone:NO];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have got Sinatra/Rails app and an action which starts some long process. Ordinary
I've got an interesting problem. I have an iPad App which has to parse
I have got a Rails app running which displays data that is generated by
I'm about to make a web app which will have a pretty heavy client
I have got a proj work, which works in this way... An app which
I am developing an app in which I have got a gallery. When I
I have created an app which using APNS. I have got the push notifications
i am developing one app in which 9i have taken CustomeButtonField class for Make
I have app in which i have recorded sound files i want that i
I have a app which will download a file from web. The download action

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.