You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sqlitepersistentobjects-user
Hi.
I'm using this library on iPhone OS 2.2.1.
I have to report a strange behaviour...
I have two classes.
Product {
NSDate *expires;
Item *item;
}
Item {
NSString *name;
}
If I delete an instance of Product class as follows (or using other
equivalent methods):
[Product deleteObject:[aProduct pk] cascade:NO];
the bound Item object will be deleted...also if I clearly specified
CASCADE:NO.
So...I've seen the implementation of deleteObject:cascade:, and I read
what follows:
if (isCollectionType(className)) {
...
}
else {
Class propClass = objc_lookUpClass([className UTF8String]);
if ([propClass isSubclassOfClass:[SQLitePersistentObject class]])
{
id theProperty = [self valueForKey:prop];
[theProperty deleteObjectCascade:TRUE];
}
}
Why a subclass of SQLitePersistentObject overrides my cascade
preference?
I corrected the if statement, but maybe I misunderstood your
purpose...