Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Change setValue to putValue

  • Loading branch information...
commit cd46b284c44f782558fe2a89094007e913dbabd6 1 parent 0bfb684
@hoisie authored
View
2  Classes/LevelDB.h
@@ -27,7 +27,7 @@ typedef BOOL (^KeyValueBlock)(NSString *key, id value);
- (id) initWithPath:(NSString *)path;
-- (void) setObject:(id)value forKey:(NSString *)key;
+- (void) putObject:(id)value forKey:(NSString *)key;
- (id) getObject:(NSString *)key;
- (NSString *) getString:(NSString *)key;
View
2  Classes/LevelDB.mm
@@ -79,7 +79,7 @@ + (LevelDB *)databaseInLibraryWithName:(NSString *)name {
return ldb;
}
-- (void) setObject:(id)value forKey:(NSString *)key {
+- (void) putObject:(id)value forKey:(NSString *)key {
Slice k = SliceFromString(key);
Slice v = SliceFromObject(value);
Status status = db->Put(writeOptions, k, v);
View
4 LevelDB/RootViewController.mm
@@ -17,11 +17,11 @@ - (void)viewDidLoad
LevelDB *ldb = [LevelDB databaseInLibraryWithName:@"test.ldb"];
//test string
- [ldb setObject:@"laval" forKey:@"string_test"];
+ [ldb putObject:@"laval" forKey:@"string_test"];
NSLog(@"String Value: %@", [ldb getString:@"string_test"]);
//test dictionary
- [ldb setObject:[NSDictionary dictionaryWithObjectsAndKeys:@"val1", @"key1", @"val2", @"key2", nil] forKey:@"dict_test"];
+ [ldb putObject:[NSDictionary dictionaryWithObjectsAndKeys:@"val1", @"key1", @"val2", @"key2", nil] forKey:@"dict_test"];
NSLog(@"Dictionary Value: %@", [ldb getDictionary:@"dict_test"]);
[super viewDidLoad];
Please sign in to comment.
Something went wrong with that request. Please try again.