Decript Database not working (objective c)

Using latest version of SQL Cipher, the decryption of an encrypted database is not working

Note that database object is a sqllite3.db encrypted and working (selects work).

int rc = 0;

NSString *unEncryptDB = [path stringByAppendingPathComponent:@“plaintext.db”];

const char * sqlQ = [[NSString stringWithFormat:@“ATTACH DATABASE ‘%@’ AS plaintext KEY ‘’;”, unEncryptDB] UTF8String];

// Attach empty encrypted database to unencrypted database
rc = sqlite3_exec(database, sqlQ, NULL , NULL , NULL );
RC returns 21, and error message is out of memory

// export database
rc = sqlite3_exec(database, “SELECT sqlcipher_export(‘plaintext’);”, NULL , NULL , NULL ); //gives error


// Detach encrypted database
rc = sqlite3_exec(database, “DETACH DATABASE plaintext;”, NULL , NULL , NULL );

Below code failed to un-encript database

Hey @dvalenzuela

Was the database encrypted using SQLCipher?

Can you provide a more complete code example?