ios - How to replicate a sentence with line breaks in between with an NSString? -
I was changing some old This sentence was being called as: It was displayed in this form: How do I do this Want to display. How do I add line breaks for NSString now? I have tried the following and they do all the work: and But the output comes from: I here What to do? Change either the straight (easy and clear) If this is a variable, you have to use Either way, this is a bad idea to get a format from a variable. Use a literal straight so that the compiler can check the logic number and type for you. UIWebViews with
UILabels and I realized that I had a string that looked like the following:
NSString * eaten = You ate & lt; B & gt;% @ & lt; / B & gt; % From
NSString * warning = [NSString stringWithFormat: eaten, "cake", "janine "];
You were drawn from Jenin
NSString * warning = [NSString stringWithFormat: @ "% @ \ R% @ \ r% @ ", Ate," cake "," jenin "]; NSString * Warning = [NSString stringWithFormat: @ "% @ \ n% @ \ n% @", eaten, "cake", "jenin"]; NSString * Warning = [NSString stringWithFormat: @ "% @ \ r \ n% @ \ r \ n% @", eaten, "cake", "jenin"];
self.warningLabel.numberOfLines = 0;
you have sent% @ to% @
eaten string or between Add a new line to
NSString * warning = [NSString stringWithFormat: eaten, @ "\ nCake \ n", @ "jenin"];
[NSString stringWithFormat: @ "\ n% @ \ n", middleVar] to create it Will be required.
Comments
Post a Comment