将作曲家文本框值添加到数组中?
我有 coredata 在文本字段中显示存储的数据
视图中didload: tfEmail.text = editEmp.email;
消息编辑器也可以工作,但是如果我想使用电子邮件数据包含在我的消息中,我就会遇到麻烦。 .
NSArray *toRecipients = [NSArray arrayWithObject:@"[电子邮件受保护] "]; [选择器 setToRecipients:toRecipients];
我需要做的是包含 tfEmail在 NSArray 中,所以如果我尝试
NSArray *toRecipients = [NSArray arrayWithObject:@"%@", tfEmail.text];
我会收到一个错误
函数 arrayWithObject 的参数过多
如何解决这个问题?
I have the coredata showing in text fields the data stored
in view didload: tfEmail.text = editEmp.email;
the message composer works as well, but if I want to use the email data to include in my message, I get the trouble...
NSArray *toRecipients = [NSArray arrayWithObject:@"[email protected]"]; [picker setToRecipients:toRecipients];
what I need to do is to include the tfEmail in the NSArray, so if I try
NSArray *toRecipients = [NSArray arrayWithObject:@"%@", tfEmail.text];
I will get an error
Too many arguments to function arrayWithObject
How do I fix this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您尝试将字符串传递给数组初始值设定项,但实际上传递了两个 字符串。应更改此行:
您正在传递两个字符串对象,
@"%@"
和tfEmail.text
。尝试删除格式字符串,如下所示:如果您想保留格式,请按如下方式包装这些字符串:
You are tryig to pass a string to the array initializer but are actually passing in two strings. This line should be changed:
You are passing in two string objects,
@"%@"
andtfEmail.text
. Try removing the format string, like so:If you wanted to keep the format, wrap those strings as follows: