This is driving me crazy! I even have a different project with the exact same h file that works fine yet this does not. Xcode keeps forcing me to have to put an @end (in bold) by putting it in red, then it rejects its own suggestion with the red error “@end must appear in objective c context”. WHAT AM I DOING WRONG!!!!!!
#import <Foundation/Foundation.h>
@class AFHTTPRequestOperation;
@protocol AFHTTPClientOperation;
@protocol AFMultipartFormData;
#ifdef _SYSTEMCONFIGURATION_H
extern NSString * const AFNetworkingReachabilityDidChangeNotification;
#endif
#ifdef _SYSTEMCONFIGURATION_H
typedef enum {
AFNetworkReachabilityStatusUnknown = -1,
AFNetworkReachabilityStatusNotReachable = 0,
AFNetworkReachabilityStatusReachableViaWWAN = 1,
AFNetworkReachabilityStatusReachableViaWiFi = 2,
} AFNetworkReachabilityStatus;
#endif
typedef enum {
AFFormURLParameterEncoding,
AFJSONParameterEncoding,
AFPropertyListParameterEncoding,
} AFHTTPClientParameterEncoding;
extern NSString * AFURLEncodedStringFromStringWithEncoding(NSString *string, NSStringEncoding encoding);
extern NSString * AFQueryStringFromParametersWithEncoding(NSDictionary *parameters, NSStringEncoding encoding);
**@end** //Here it keeps trying to force me to place an @end, then gives the error "@end must appear in objective c context"
@interface AFHTTPClient : NSObject <NSCoding, NSCopying>
...
@end
Most likely you are missing and @end in a different .h file. So probably you have one file #importing the corrupted .h (missing @end) and then you #import this file. That would explain the error.