4

静的テキスト データがあるため、UITexView に長いテキストを貼り付けるにはどうすればよいですか。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.";

上記は私が試している方法です。

4

8 に答える 8

4

プログラムで設定する場合は、1 行で設定する必要があります。

txtView.text = @"About us\n\nmyevent.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!\n\nHow 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.";
于 2013-07-23T11:09:24.640 に答える
1

試す :

txtView.txt = @"About us\n myevent.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! \nHow 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.";

あなたが得ているエラーは、文字列で指定した入力の coz です。したがって、コンパイラはステートメントの終わりを理解できません。

于 2013-07-23T11:08:13.397 に答える
1

プロパティファイル「about.plist」を追加

NSDictionary *dic=[NSDictionary dictionaryWithContentsOfFile:[[NSBundle mainBundle]pathForResource:@"about" ofType:@"plist"]];
NSLog(@"%@",dic);
于 2013-07-23T11:12:58.057 に答える
1

複数の行にテキストを書きたい場合は\、各行の最後に文字を追加できます。

txtView.txt = @"About us\

myevent.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!\

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.  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.";
于 2013-07-23T11:22:30.373 に答える