Ok for some reason my code wont play nice and I'm too new to cocoa to figure this out on my own..
when the send button is pressed it is meant to run the createEmail method. But it says
GDB: Program received signal: "EXC_BAD_ACCESS". when the button is pressed.
#import "Controller.h"
@implementation Controller
-(IBAction)send:(id)sender{
[self createEmail];
}
-(void)createEmail{
NSString *number = [numfield stringValue];
NSString *carrier = [carrierfield stringValue];
NSString *carrierTag;
[carrier lowercaseString]; //make all lowercase
//set carrierTag based on what carrier it is
if ([carrier isEqualToString:@"verizon"]) {
carrierTag = @"@vtext.com";
}
if ([carrier isEqualToString:@"at&t"]) {
carrierTag = @"@txt.att.net";
}
if ([carrier isEqualToString:@"nextel"]) {
carrierTag = @"@messaging.nextel.com";
}
if ([carrier isEqualToString:@"sprint"]) {
carrierTag = @"@messaging.sprintpcs.com";
}
if ([carrier isEqualToString:@"cingular"]) {
carrierTag = @"@cingularme.com";
}
if ([carrier isEqualToString:@"cingular"]) {
carrierTag = @"@cingularme.com";
}
if ([carrier isEqualToString:@"virgin"]) {
carrierTag = @"@vmobl.com";
}
if ([carrier isEqualToString:@"t-mobile"]) {
carrierTag = @"@tmomail.net";
}
//Concatenate number and carrierTag to create an email address
email = [number stringByAppendingString:carrierTag];
}
@end