I have an Address interface as this:
@interface AddressCard : NSObject
{
NSString *name;
NSString *email;
}
@property (copy, nonatomic) NSString *name, *email;
-(void) print;
-(void) setName:(NSString *) theName andEmail:(NSString *) theEmail;
-(void) dealloc;
@end
And implementation as:
#import "AddressCard.h"
@implementation AddressCard
@synthesize name, email;
-(void) setName:(NSString *) theName andEmail: (NSString *) theEmail
{
self.name = theName;
self.email = theEmail;
}
-(void) print
{
NSLog (@"==============================");
NSLog(@"| %-21s |", [self.name UTF8String]);
NSLog(@"| %-21s |", [self.email UTF8String]);
NSLog (@"==============================");
}
-(void) dealloc
{
[name release];
[email release];
[super dealloc];
}
@end
When I run it I keep getting an EXEC_BAD_ACCESS during the pool drain. I'm unable to find the cause and any help is appreciated. This is my first step into Objective-C so please bear with me.
thanks Sunit