objective c - iphone global variable -
I want to open my SQLite database in my App Delegate class and references that in all my other classes in the database I have a database Have tried: static sqlite3 * database = zero;
But when I append it to my other classes. If I try to refer to the database, then "error: request for member" is not a structure or association in some way. "How do you reference these types of proprians?
You should use any variable that is stored in an app representative, follow the normal formula:
YourAppDelegateName * delegate = (YourAppDelegateName *) [[UIApplication ShareApp] representative]; // The use of specific variables in the rep is as follows: sqlite3 * temp = delegate.database;
Comments
Post a Comment