@property(nonatomic,retain) NSObject * exVal;
@synthesize exVal;
- (void)setExVal:(NSObject*) val {
exVal = [val retain];
}
this is wrong. coz if val is equal to exVal, both exVal and val are released. and then nil retain.
- (void)setExVal:(NSObject*) val {
[val retain];
[exVal release];
exVal = val;
}
this is right.