Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3667026
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T01:57:04+00:00 2026-05-19T01:57:04+00:00

i have a issue , i am asking as new question as previoes one

  • 0

i have a issue , i am asking as new question as previoes one was messed

NSString *s=@"hi\nhello\n\nwelcome to this world\ni m jhon"
label.frame = ...//big enough height
label.numberOfLines = 0;
label.text = s;

this code helps me to separate string based on \n

but if i do this

NSString *s=Ad.content //where Ad.content value is **hi\nhello\n\nwelcome to this world\ni m jhon**


label.numberOfLines = 0;
label.text = s;

i am not able to sperate them by \n , what i am doing wrong here kindly suggest

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T01:57:04+00:00Added an answer on May 19, 2026 at 1:57 am

    “\n” is not a special token handled by UILabel. It is, in fact, a special token handled by the compiler. When the compiler sees “Hello\nWorld”, it converts that into the sequence of characters 'H' 'e' 'l' 'l' 'o' LF 'W' 'o' 'r' 'l' 'd' (where LF is ASCII code 10, or newline). For whatever reason, your Ad.content contains literal “\n” sequences instead of newlines. The best solution is to look at where the content of Ad.content comes from and fix it to actually have real newlines instead of “\n” sequences. If you absolutely must have “\n” sequences, then you can use -[NSMutableString stringByReplacingOccurrencesOfString:withString:]. Of course, if anyone wants to have the literal sequence “\n” show up, then they can’t do that. If you want to support generic backslash-escaping (so the literal sequence “\n” would be represented as “\n”), then you can use a more complicated approach with NSScanner where you find each “\”, pull out the next character, and handle it appropriately.

    My recommendation is to fix Ad.content to contain actual newlines.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have already asked this question on ServerFault however I got very minimal replies....one
We are new to ROR, We have issue in creating Login/Logout process in ROR
This is homework...I'm not asking for answers, I just have a bug I'm not
First of all this is the first time I am asking a java question
I have had this issue for sometime on my app and it always bothered
I'm just asking theoretical question. I' have an operation which takes some period of
i have a quick question about objectify - this may be in the actual
I am new in Databases so please ignore my way asking ! I have
I'm asking what is probably a fundamental question but I'm relatively new to iOS
I'm a bit new to spservices, and I hope I'm not asking a question

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.