开发者

How to Gathering a UITextField and a UILabel value and sending to an email

开发者 https://www.devze.com 2023-03-22 17:08 出处:网络
I have setup eve开发者_如何学Pythonrything with the in-app email. I\'m trying to gather the UITextField value and UILabel value then send the information to the \"body\" of an email. Here is the line

I have setup eve开发者_如何学Pythonrything with the in-app email. I'm trying to gather the UITextField value and UILabel value then send the information to the "body" of an email. Here is the line of code that I believe needs tweaked:

NSString *message = [NSString stringWithFormat:@"tex2.text %@ label2.text %@"];
[composer setMessageBody:message isHTML:NO];


Your stringWithFormat call is missing the UITextField and UILabel parameters:

// format your body text. I have added a couple of \n characters to move the label text to the third line.
NSString *message = [NSString stringWithFormat:@"tex2.text %@\n\nlabel2.text %@", yourTextField.text, yourLabel.text];


If you define your textField and label in your header, you can just get the value like this:

NSString *message = [NSString stringWithFormat:@"tex2.text %@ label2.text %@",myTextField.text, myLabel.text];
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号