No storage class may be specified (Objective-c ) error
I keep getting
error: no type or storage class may be specified here before 'interface'
Here's the image:
and the code:
#import <Foundation/Foundation.h>
@interface Utilities : NSObject {
}
+ (NSString *)getDocumentsDirectory;
+ (void)showActivityIndicator;
+ (void)hideActivityIndicator;
+ (void)setUser:(NSString *)userName withPassword:(NSString *)password;
+ (NSString *)getUserName;
+ (NSString *)getPassword;
+ (long long)generateTicketNumber;
+ (BOOL)reachable;
+ (NSString *)printerAddress;
+ (NSInteger)port;
+ (void)setAddress:(NSString*)newAddress andPort:(NSInteger)newPort;
+ (void)showDataActivity;
@end
@开发者_运维百科interface CustomUITextField:UITextField{
NSInteger rowNumber;
}
@property (nonatomic) NSInteger rowNumber;
@end
I reduced the .m file to just simple:
#import "Utilities.h"
@implementation Utilities
@end
I still get the error. (Ofcourse I get warnings for not implementing methods).
I have been trying to figure out what's wrong for past 2-3 hours. Please help. Thanks.
**UPDATE:**I split up the two classes and all of a sudden, I am gettting "property declaration not found ...." error in a totally different class.
Here's my DataCenter.h
#import <Foundation/Foundation.h>
@interface DataCenter : NSObject {
BOOL updating;
NSDictionary *dataDictionary;
}
@property (nonatomic, retain) NSDictionary *dataDictionary;
+ (DataCenter *)sharedInstance;
- (void)update;
- (NSArray *)getSTData;
- (BOOL)saveSTData;
- (NSArray *)getLookUpsData;
- (NSDate *)lastUpdated;
- (NSArray *)pendingData;
- (void)registerNewTicket:(NSDictionary *)ticketInfo;
- (void)savePendingData:(NSArray *)data;
@end
And I am getting "Property declaration not in implementation or interface context"
The contents of the header file will be compiled wherever you include/import this header. Check to see that you aren't importing Utilities.h in some other file where there is an error before the #import.
精彩评论