电子邮件表格查看文本
我知道如何添加应用程序电子邮件,但我不知道如何通过电子邮件发送表格视图的文本。我这样做,但我的问题是,当用户将单元格添加到表格中时,我如何才能将其打印出来? 为了正常打印出我会使用的文本
string = [[NSString alloc]initWithFormat:@"%@ \n %@ \n %@",[array objectAtIndex:0],
[array objectAtIndex:1],
[array objectAtIndex:2]];
,并将电子邮件正文设置为字符串。有谁知道如何将其添加到添加新单元格的位置,我也可以将其添加到电子邮件正文中?
谢谢
i know how to add in app email, but i dont know how to email the text of my table view. I do, but my problem is that when the user adds a cell to the table, how do i get that to print out too?
to print out the text normally i would use
string = [[NSString alloc]initWithFormat:@"%@ \n %@ \n %@",[array objectAtIndex:0],
[array objectAtIndex:1],
[array objectAtIndex:2]];
and i set the email Body to string. Does anyone know how to make it to where if a new cell is added, i can get it to be added to the email body as well??
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我不是 100% 确定我理解你的问题,但这里是。 。 。
您可以使代码处理超过固定数量的项目,如下所示:
如果
array
也是表视图的数据源,则string
应包含所有表细胞之间有间隙。您只能在向用户显示电子邮件视图之前更新 MFMailComposeViewController 中的电子邮件正文 - 一旦显示,它就是只读的:(
I'm not 100% sure I understand your problem but here goes . . .
You can make your code deal with more than a fixed number of items like this :
If
array
is also the data source for your table view thenstring
should then contain all the table cells with a break between them.You can only update the body of your email in an MFMailComposeViewController before you have shown the email view to the user - once it's been displayed then it's read only :(
我在这里假设您的数组填充有字符串对象。
编写字符串:
现在,假设您还有一个 MailViewController 实例,实例化为 mailViewController,请在正文中写入以下代码:
I assume here that your array is populated with string objects.
Compose the string:
Now, assuming you also have an instance of MailViewController, instantiated as mailViewController, write this code in for the body:
首先使用上面所示的方法填充
UItableView
格式化字符串,然后在您的:- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
中:希望这有帮助。
First populate the
UItableView
formatting the strings with the methods indicated over, then in your:- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
:Hope this helps.