This is a common convention that delegates are not saved. This is mainly due to the fact that the usual template is that the owner of the object is often also its delegate, and if the delegate was saved, you will get a save cycle.
If you use a property, declare it as follows:
@property (assign) DelegateType delegate;
And remove the line in -dealloc , which frees the delegate.
If accessors are synthesized, you do it. If this is not the case, make accessories the destination of accessories, for example.
-(DelegateType) delegate { return delegate; } -(void) setDelegate: (DelegateType) newValue { delegate = newValue; }
Jeremyp
source share