I want to take two value from user i.e name and location and then want to concatenate them into single string to produce output string
IBOutlet UITextField *txtName;
IBOutlet UITextField *txtLoc;
Want to concatenate them to produce below string.
Student Name is txtName and He is from txtLoc
Basically that’s my complete code.
NSString *message = [NSString stringWithFormat:@"Student Name is %@ from %@ phone Number is%@ and he want to say%", txtName.text, txtLoc.text,txtPho.text,txtBody.text];
-(void) send:(id) sender {
[self sendEmailTo:@"naumankhattak@gmail.com" withSubject:@"Contact for Quran Focus from iphone Application" withBody:message];
That’s what I want to do.
and em getting error
‘txtName’ undeclared here(not in a function)
‘txtLoc’ undeclared here(not in a function)
‘txtPho’ undeclared here(not in a function)
‘txtBody’ undeclared here(not in a function)
Though I have correctly declared all outlets.
You need to put your message assignment line inside the send: function, just before the call to sendEmailTo:withSubject:withBody:.