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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:53:35+00:00 2026-05-27T20:53:35+00:00

I am succesfuly using AsiHttpRequest library to make url connections in my apps. However,

  • 0

I am succesfuly using AsiHttpRequest library to make url connections in my apps. However, I upgrade to iOS5 and Reachability.m file is reporting some errors (4) on following functions:

static void ReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkReachabilityFlags flags, void* info) {

    #pragma unused (target, flags)
    NSCAssert(info, @"info was NULL in ReachabilityCallback");
    NSCAssert([(NSObject*) info isKindOfClass: [Reachability class]], @"info was the wrong class in ReachabilityCallback");


    // Post a notification to notify the client that the network reachability changed.
    [[NSNotificationCenter defaultCenter] postNotificationName: kReachabilityChangedNotification object: (Reachability *) info];


} // ReachabilityCallback()


- (BOOL) startNotifier {

    SCNetworkReachabilityContext    context = {0, self, NULL, NULL, NULL};

    if(SCNetworkReachabilitySetCallback(reachabilityRef, ReachabilityCallback, &context)) {

        if(SCNetworkReachabilityScheduleWithRunLoop(reachabilityRef, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode)) {

            return YES;

        }

    }

    return NO;

} // startNotifier

1sr error: in NSCAssert line, “Cast of C pointer type ‘void’ to Objective-C pointer type NSObject requires a bridged cast”. Why happens and how to solve it?

ANSWER: you can disable ARC for each file. Go to build settings of your project and set the -fno-objc-arc flag on all the ASIHTTPRequest files (double click to edit text). Then you must remove ASIAuthenticationDialog and any references to it that are still generating errors. It works for 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-27T20:53:35+00:00Added an answer on May 27, 2026 at 8:53 pm

    EDIT: I remember now and yes, the problem is ARC. But you can exclude files from being complied under ARC by setting the following compiler flag in Build Phases >> Compile Sources: -fno-objc-arc. If you select all the ASIHTTPRequest files and double-click, you can set the flag for all of them in one fell swoop.

    ORIGINAL POST:

    I’ve been using ASIHTTPRequest for a couple of weeks now and I remember reading a post somewhere about problems with Reachability, I just can’t remember what it was exactly.

    Anyway, this is what those lines in my Reachability.m look like:

    //Start listening for reachability notifications on the current run loop
    static void ReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkReachabilityFlags flags, void* info) {
    
    #pragma unused (target, flags)
    NSCAssert(info, @"info was NULL in ReachabilityCallback");
    NSCAssert([(NSObject*) info isKindOfClass: [Reachability class]], @"info was the wrong class in ReachabilityCallback");
    
    //We're on the main RunLoop, so an NSAutoreleasePool is not necessary, but is added defensively
    // in case someone uses the Reachablity object in a different thread.
    NSAutoreleasePool* pool = [NSAutoreleasePool new];
    
    // Post a notification to notify the client that the network reachability changed.
    [[NSNotificationCenter defaultCenter] postNotificationName: kReachabilityChangedNotification 
                                                        object: (Reachability *) info];
    
    [pool release];
    
    } // ReachabilityCallback()
    
    
    - (BOOL) startNotifier {
    
        SCNetworkReachabilityContext    context = {0, self, NULL, NULL, NULL};
    
        if(SCNetworkReachabilitySetCallback(reachabilityRef, ReachabilityCallback, &context)) {
    
            if(SCNetworkReachabilityScheduleWithRunLoop(reachabilityRef, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode)) {
    
                return YES;
    
            }
    
        }
    
        return NO;
    
    } // startNotifier
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to upload images in server using ASIHTTPRequest library in my IPhone app.
I am using ASIHTTPRequest for downloading file from server but its giving error Failed
I am using the ASIFormDataRequest for uploading file on server. I am using ASIHTTPRequest
I am using the ASIHTTPRequest Queue in a seperate class file from my main
I'm successfully using yajl-objc along with ASIHTTPRequest in an iPhone project that does network
I succesfully created a project using seam credentials for authentication, but right now some
I'm not getting cached results using the ASIHTTPRequest Cache functionality. I followed the directions
I am sending a post using NSURLRequest. NSURL *url = [NSURL URLWithString:someUrlString]; NSMutableURLRequest *theRequest
I am developing some software using VTK. I have compiled VTK succesfully using CMake.
I've succesfully loaded and parsed this XML file, using XMLParser and AS2: <Resources> <item

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.