2

我最近将InAppSettingsKit添加到一个项目中(尽管我不认为这是特定于 IASK 的)。

我正在使用 Xcode 4.2,它给出了一个奇怪的错误:

 /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

如果我注释掉该行,它将建立正常。

我已经尝试了所有常见的 Xcode 技巧,清理、重新启动、删除派生数据文件夹等。

4

1 回答 1

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
于 2011-12-12T11:49:37.107 回答