i get EXC_BAD_ACCESS while formatting string.
NSString *object = [[NSUserDefaults standardUserDefaults] stringForKey:@"ObjectNumber"];
NSString *pin = [[NSUserDefaults standardUserDefaults] stringForKey:[NSString stringWithFormat:@"Pin%i ",object.intValue]];
NSString *msg = [NSString stringWithFormat:@"%@N", pin];
NSString *msg2 = @"0001N";
NSLog(@"Sending %@", msg);
tcpConnection *Obj = [tcpConnection alloc];
[Obj loadUpConnection:msg];
If i use msg2 everything works fine. But if i use msg it gets exc_bad_access even though NSLog prints msg correctly.
tcpConnection *Obj = [tcpConnection alloc];why did you not use thetcpConnection *Obj = [[tcpConnection alloc] init];?