Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HttpClient setReachabilityStatusChangedBlock declares no interface

Trying to use AFNetworkings ReachabilityStatusChanged but getting

"No visible @interface for HTTPCLIENT declares the selector setReachabilityStatusChangeBlock"

But HttpClient has that function. Anyone know why this is happening?

AFHTTPClient *client = [[AFHTTPClient alloc] initWithBaseURL:[NSURL URLWithString:@"http://stat-api.herokuapp.com/"]];
[client setReachabilityStatusChangeBlock:^(AFNetworkReachabilityStatus status){

    NSLog(@"%d", status);

}];

/// UPDATE ///////////

Here is my .pch file

#ifdef __OBJC__
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#import <CoreData/CoreData.h>
#import "NSDate+Helper.h"
#import "NSEntityDescription+RKAdditions.h"
#import "UIAlertView+MKBlockAdditions.h"
#import "UIActionSheet+MKBlockAdditions.h"
#import "MKBlockAdditions.h"
#import "NSObject+MKBlockAdditions.h"
#import "NSString+Extra.h"
#import "UIView+Additions.h"
#import "ObjectiveSugar.h"
#import "NSNotificationCenter+UniqueNotif.h"
#import "STUIColor+Custom.h"
#import "NSObject+STNSObjectAdditions.h"
#import "UIView+Gradientcy.h"
#import "NSString+USStateMap.h"
#import "STUITextField.h"
#import "UIImage+UIImageCrop.h"
#import "UIBorderLabel.h"
#import <SystemConfiguration/SystemConfiguration.h>



#endif
like image 813
jdog Avatar asked Jun 07 '26 23:06

jdog


1 Answers

Move

#import <SystemConfiguration/SystemConfiguration.h>

right after this line:

#ifdef __OBJC__
like image 106
Shmidt Avatar answered Jun 10 '26 06:06

Shmidt



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!