Skip to Content
0
Former Member
Oct 29, 2015 at 05:40 PM

SUP Persistence Exception while unsubscribe database

22 Views

-(BOOL)isInitialSyncDone {

BOOL initialSyncDone=NO;

NSUserDefaults *stdUserDflts = [NSUserDefaults standardUserDefaults];

SUPApplication* app = [SUPApplication getInstance];

if([stdUserDflts boolForKey:DIFFERENT_SERVER])

{

if([app connectionStatus] == SUPConnectionStatus_CONNECTED) {

NSLog(@"Unregistering application");

@try {

//[VisualInspection_DVIDB initialize];

[VisualInspection_DVIDB deleteDatabase];

[VisualInspection_DVIDB closeConnection];

} @catch(NSException *exception) {

//make sure that the db is getting deleted

NSLog(@"Exception Caught while unregistering applicaiton.");

NSLog(@"%@ %@", [exception name],[exception description]); }

@finally {

}

}

}

if ([VisualInspection_DVIDB databaseExists] && [VisualInspection_DVIDB isSynchronized:PROJECT_GROUP])

{

initialSyncDone=YES;

}

return initialSyncDone;

}