0

i am trying to split the string to multilines when tweeting using the twitter composer in iOS 5+ but could not find the way to do it

i tried everything in this Click Here

but nothing worked , its always gets to single line

is it possible to do it ?

update :

example for what i need

lets say i want to tweet this

"Hello John, Welcome to our website, we hope that you enjoy it"

instead of tweeting it like that , i want to look like this

"Hello John,

Welcome to our website,

we hope that you enjoy it"

Community
  • 1
  • 1
aLFaRSi
  • 559
  • 2
  • 12
  • 29
  • You found a wrong answer to use as your example: the question that you linked talks about making a single line that appears in your code as multiple lines; my understanding is that you are looking for the opposite effect. You may want to look [here](http://stackoverflow.com/a/594123/335858) instead. – Sergey Kalinichenko Mar 24 '12 at 09:33
  • @dasblinkenlight ok can u help me with it ? how can i tweet multilines using twitter compose ? – aLFaRSi Mar 24 '12 at 09:37
  • the question is not very clear. Show an example of the text before and after the splitting. I don't know what you want to achieve. Are you just looking for `@"\n"`? – Matthias Bauch Mar 24 '12 at 10:24
  • @MatthiasBauch here is the example :) – aLFaRSi Mar 24 '12 at 11:01

1 Answers1

2

I guess your question is just about how to create a multi-line NSString. answer would be:

@"This is the first line.\nThis is the second line."

or

NSString *tweetString = [NSString stringWithFormat:@"%@\n%@", myFirstLineString, mySecondLineString];

edit: for your updated question it would be that:

NSString *tweetString = "Hello John,\nWelcome to our website,\nwe hope that you enjoy it"
Thyraz
  • 2,412
  • 2
  • 21
  • 23