I'd like to split up executing a query. The myprepare function below opens the database connection and runs the sqlite3_prepare_v2 function. Once sqlite3_open is executed within the scope of the myprepare, selectstmt and database have valid addresses assigned to them. However, once I come out of myprepare, their addresses are wiped to 0x0.
sqlite3_stmt *selectstmt = nil;
sqlite3 *database = nil;
[anInstance myprepare:selectstmt theDatabase:database]; //assignments are fine inside here
//here, the above values will be 0x0
Why aren't the values of selectstmt and database retained outside of myprepare?