- Fix SharedInstance User

- Fix Object save Locally
- Fix Object fetch Locally
- Add Object delete Locally
This commit is contained in:
giuseppenuc committed 2016-01-26 12:26:49 +01:00
1 parent 7e5a6149a8
commit 4c97b281ed
9 files changed
+81 -48

No files matched your search

+10 -8
View File
@@ -77,15 +77,17 @@ static bool isFirstAccess = YES;
if (isFirstAccess) {
[self doesNotRecognizeSelector:_cmd];
}
self = [super init];
NSDictionary *savedUser = [[PNObjectModel sharedInstance] fetchObjectsWithClass:[self class]];
if (savedUser) {
self = [super initWithJSON:savedUser];
}
else {
self = [super init];
}
if (self) {
[self setSubClassDelegate:self];
super.JSON = [super.objectModel fetchObjectsWithClass:[self class]];
if(super.JSON){
[super populateObjectFromJSON:super.JSON];
}
}
return self;
}