AlexDenisov / iActiveRecord

ActiveRecord for iOS without CoreData, only SQLite
http://alexdenisov.github.com/iActiveRecord/
MIT License
354 stars 50 forks source link

Save doesn't work #13

Closed thepatrick closed 11 years ago

thepatrick commented 12 years ago

I have code, much like:

Properties: _id, _rev, site (all NSString), jsonRepresentation (NSData)

SomeRecord *sr = [SomeRecord newRecord];
sr._id = @"something";
sr.site = @"mine";

[api doStuff:^(NSDictionary*)r {
  NSError *err;
  sr.jsonRepresentation = [NSJSONSerialization dataWithJSONObject:r options:kNilOptions error:&err];
  sr._rev = r[@"_rev"];
 [sr save];
}];

But while I can log, just before [sr save] the values of sr._id and sr.jsonRepresentation and they are all correct, logging the object itself shows that its idea of reality is clearly inconsistent:

_id => (null);_rev => 3-d502435ac80cc2b3fd78facdc2399e51;site => (null);jsonRepresentation => (null);id => (null);updatedAt => (null);createdAt => (null);
AlexDenisov commented 12 years ago

Which tag/branch you use?