For some reason, using loadNibNamed: is leaving me with a memory leak.
Let's say I have the interfaces:
@interface Step : UIViewController
{
IBOutlet UIView *keyPadPopupView;
}
@property (nonatomic, assign) IBOutlet UIView *keyPadPopupView;
In Step:
@synthesize keyPadPopupView;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]))
{
[[NSBundle mainBundle] loadNibNamed:@"customNumberKeypad" owner:self options:nil];
[self.view addSubview:keyPadPopupView];
[keyPadPopupView release];
}
return self;
}
- (void) dealloc
{
NSLog(@"dealloc........%@", [self class]);
[super dealloc];
}
I perform the init using:
Step *step = [[Step alloc] initWithNibName:@"StepXib" bundle:nil];
[step release];
I can't seem to figure out why the dealloc method is never called. Inside the Xib, the file's owner is Step, and the keyPadPopupView is connected in IB.
Is there something I'm missing?
Thanks!