Hey all,
i have a very simple cocoa app that counts the letters in a NSTextField. I have a controller object with outlets and actions defined to do the work. This controller object has a dealloc method but it doesn't seem to execute when the application ends and is being deallocated. Everything else executes as expected except for the dealloc. I even put a breakpoint in the code to see if it executes but it never breaks in dealloc.Below is the code.
Any ideas / suggestions are welcome.
#import "AppController.h"
@implementation AppController
- (IBAction)countLetters: (id)sender
{
NSString *message = [inputTextBox stringValue] ;
int length = [message length] ;
NSString *newMessage = [NSString stringWithFormat
"%@ has %d letters",message,length] ;
[letterCounter setStringValue:newMessage] ;
NSLog(@"Set new value to %@",message) ;
}
- (void) dealloc
{
NSLog(@"testing....") ;
NSLog(@"Deallocating AppController") ;
[super dealloc];
}
- (void)awakeFromNib
{
[inputTextBox setStringValue
"this is the initial string"];
NSLog(@"waking up the NIB");
}
- (id)init
{
[super init];
NSLog(@"Init...");
return self ;
}
@end
i have a very simple cocoa app that counts the letters in a NSTextField. I have a controller object with outlets and actions defined to do the work. This controller object has a dealloc method but it doesn't seem to execute when the application ends and is being deallocated. Everything else executes as expected except for the dealloc. I even put a breakpoint in the code to see if it executes but it never breaks in dealloc.Below is the code.
Any ideas / suggestions are welcome.
#import "AppController.h"
@implementation AppController
- (IBAction)countLetters: (id)sender
{
NSString *message = [inputTextBox stringValue] ;
int length = [message length] ;
NSString *newMessage = [NSString stringWithFormat
[letterCounter setStringValue:newMessage] ;
NSLog(@"Set new value to %@",message) ;
}
- (void) dealloc
{
NSLog(@"testing....") ;
NSLog(@"Deallocating AppController") ;
[super dealloc];
}
- (void)awakeFromNib
{
[inputTextBox setStringValue
NSLog(@"waking up the NIB");
}
- (id)init
{
[super init];
NSLog(@"Init...");
return self ;
}
@end