If a UIviewController subclass is created, the method 'dealloc' is created automatically for you.
- (void)dealloc{}
However, when I create a Objective-C Class, the method is not auto-created. Is it necessary to add the dealloc method so that I can release the properties in the class? Especially if I have retained them in the header file?
For example in my Objective-C class header file I have
@interface ClassA : NSObject
{
NSString *someProperty;
UINavigationController *navcon;
}
@property (nonatomic, retain) NSString *someProperty;
@property (nonatomic, retain) UINavigationController *navcon;
Do I need to manually create a dealloc method to release the properties as below?
-(void)dealloc
{
[someProperty release];
[navcon release];
}