最近遇到一个问题,用户数据丢失,拿到用户数据库文件以后,发现数据库损坏. database disk image is malformed 因此希望可以找到一种方法,可以检测出来数据库是否损坏,经过google,找到了一种方法,先记录下来. + (BOOL)checkIntegrity { NSString *databasePath = [self databaseFilePath]; // File not exists = okay if ( ! [[NSFileManager defau…