Hi, I have this:
Then, I create:
I don't understand why fail in the release part, if I say retain in the property. Happend the same thing if I put retain in the init.
If I remove this line, I don't get a error, but that not sound rigth to me....
Code:
@interface Db : NSObject {
NSString *path;
FMDatabase* theDb;
}
@property(readonly, retain) FMDatabase *theDb;
@property (readonly, nonatomic) NSString *path;
Then, I create:
Code:
- (id)initWithName:(NSString *)name{
self = [super init];
if (self) {
path = [name copy];
theDb = [[FMDatabase alloc] initWithPath:path];
}
return self;
}
- (void)dealloc
{
NSLog(@"Deallocating %@", self);
[theDb release]; <----FAIL!!!
[path release];
[super dealloc];
}
I don't understand why fail in the release part, if I say retain in the property. Happend the same thing if I put retain in the init.
If I remove this line, I don't get a error, but that not sound rigth to me....