Compilation error when using sqlite3: the property with the attribute "save (or strong)" must be an object type

I get a compilation error in the code below when I try to declare an sqlite3 object. Is a "database" not an object type? Why is this happening, and how can I fix it?

#import <Foundation/Foundation.h>
#import <sqlite3.h>

@interface BasicDao : NSObject

@property (nonatomic, retain) sqlite3 *database;  //error : Property with 'retain (or strong)' attribute must be of object type

@end
+3
source share
1 answer

sqlite3 *databaseIt is not a pointer to an Objective-C object, but a pointer to struct sqlite3. You cannot retain/ release, since memory is not controlled at runtime by Objective-C. Use assigninstead retain.

+8
source

All Articles