问题描述
- UITextView中粘贴长文本
-
如何在UITextView中粘贴长文本?现在我只要一将数据粘贴到textView.text中就会出错。txtView.txt = @"About us myventr.co is a web-based tool for event creation, event searching and online ticket selling whilst also serving as a social media network. myventr.co is not just about creating events and buying tickets online but is also a place for you to socialise. You can create your own profile, connect with friends or create your own group for your organisation! How is this different to other social media websites then? Myevent is about connecting people’s social lives and events all at the same place. myventr.co will help find all the event details around your location and will also help avoid events clashing by simply searching the Event Calendar before creating an event.";
这是报错的代码。
解决方案
在下一行不要用文本,在新文本行使用'n'
解决方案二:
设置到一行里:
txtView.text = @"About usnnmyevent.co is a web-based tool for event creation, event searching and online ticket selling whilst also serving as a social media network. myevent.co is not just about creating events and buying tickets online but is also a place for you to socialise. You can create your own profile, connect with friends or create your own group for your organisation!nnHow is this different to other social media websites then? Myevent is about connecting people’s social lives and events all at the same place. myevent.co will help find all the event details around your location and will also help avoid events clashing by simply searching the Event Calendar before creating an event.";
时间: 2024-11-08 17:28:12