2

I recently added InAppSettingsKit to a project (although I don't think this is IASK specific).

I'm using Xcode 4.2 and it is giving a strange error:

 /Users/Username/Documents/ProjectName/a-branch/app-name/Code/InAppSettingsKit/Models/IASKSettingsStore.h:22:18: error: expected a type [1]
  - (void)setBool:(BOOL)value forKey:(NSString*)key;
                   ^ 1 error generated.  

Xcode "Parse issue", "Unexpected type" in @protocol declaration

If I comment out the line it will build ok.

I've tried all the usual Xcode tricks, clean, restart, delete derived data folder etc.

Peter Hosey
  • 95,783
  • 15
  • 211
  • 370
Richard Stelling
  • 25,607
  • 27
  • 108
  • 188
  • The project is almost 750k loc and this is the first error of this type. – Richard Stelling Dec 12 '11 at 11:27
  • 1
    I wasn't able to reproduce this in Xcode 4.2.1 with the current IASK source (revision 5fd23fd), and at any rate, that code is valid. If this was a bug in Xcode or the compiler you're using, it seems to have been fixed. – Peter Hosey Dec 12 '11 at 14:59

1 Answers1

0

This works but I still like to understand the error more:

Move the - (void)setBool:(BOOL)value forKey:(NSString*)key; line to the bottom.

@protocol IASKSettingsStore <NSObject>
@required
- (void)setBool:(BOOL)value forKey:(NSString*)key;
- (void)setFloat:(float)value    forKey:(NSString*)key;
- (void)setDouble:(double)value  forKey:(NSString*)key;
- (void)setInteger:(int)value    forKey:(NSString*)key;
- (void)setObject:(id)value      forKey:(NSString*)key;
- (BOOL)boolForKey:(NSString*)key;
- (float)floatForKey:(NSString*)key;
- (double)doubleForKey:(NSString*)key;
- (int)integerForKey:(NSString*)key;
- (id)objectForKey:(NSString*)key;
- (BOOL)synchronize; // Write settings to a permanant storage. Returns YES on success, NO otherwise
@end

This compiles (????)

@protocol IASKSettingsStore <NSObject>
@required
- (void)setFloat:(float)value    forKey:(NSString*)key;
- (void)setDouble:(double)value  forKey:(NSString*)key;
- (void)setInteger:(int)value    forKey:(NSString*)key;
- (void)setObject:(id)value      forKey:(NSString*)key;
- (BOOL)boolForKey:(NSString*)key;
- (float)floatForKey:(NSString*)key;
- (double)doubleForKey:(NSString*)key;
- (int)integerForKey:(NSString*)key;
- (id)objectForKey:(NSString*)key;
- (BOOL)synchronize; // Write settings to a permanant storage. Returns YES on success, NO otherwise
- (void)setBool:(BOOL)value forKey:(NSString*)key;
@end
Richard Stelling
  • 25,607
  • 27
  • 108
  • 188