I am programatically trying to check the size of SQLite
database stored on the iphone after deleting some rows. The records get deleted, but the file size remains the same. Is there any way I can get the correct size of file after deleting records from sqlite in iOS? Please see the code below:
NSString* databasePath = [[NSString alloc]
initWithString: [self.documentsDirectory stringByAppendingPathComponent: self.databaseFilename]];
unsigned long long fileSize = [[[NSFileManager defaultManager]
attributesOfItemAtPath:databasePath error:nil] fileSize];
Thanks!
I cant use the vaccum approach because it deletes all the records . I am deleting 50% of data only, and not all. So this is not duplicate of this question change sqlite file size after "DELETE FROM table"