Objective-C: EXC_BAD_ACCESS и не отвечает

Вот файл заголовка:

@interface calc : NSObject {
    IBOutlet NSTextField *tf1;
    IBOutlet NSTextField *tf2;
    IBOutlet NSTextField *ansr;
    int s;
}

- (IBAction)add:(id)sender;

@end

А вот файл реализации:

@implementation calc

- (IBAction)add:(id)sender
{
    s = [tf1 intValue] + [tf2 intValue];
    [ansr setStringValue:(@"%@", s)];



}
- (void) dealloc {
    [tf1 release];
    tf1 = nil;
    [tf2 release];
    tf2 = nil;
    [ansr release];
    ansr = nil;
    [super dealloc];
}
@end
0
задан Peter Hosey 5 June 2011 в 01:45
поделиться