I am parsing a string from my plist and trying to break it into two parts to display them in two or three lines as per the break.
NSArray * parts = [text componentsSeparatedByString:@"\n"]; // this text is coming from plist.
int nthLine = 0;
for(NSString *str in parts)
{
CGRect outerFrame = CGRectMake(frame1.origin.x, frame1.origin.y + 45*nthLine, frame1.size.width, 45);
SFNDoorStyledView * question = [[SFNDoorStyledView alloc]initWithFrame:outerFrame];
question.backgroundColor = [UIColor clearColor];
question.tag = 2;
[question drawString:text inRect:CGRectMake(0,0,500,150) usingFontNamed:@"Futura-Bold" size:40.0 lineSpacing:40.0 kernValue:-3.0 color:@"#7d7066"];
[self.view addSubview:question];
}
nthLine = nthLine +1;
Actually plist saves your string as a text. SO if you enter \n it takes it as a text and not as linebreak. In spite of doing it i break the string in plist only. For ex: if you have a string , What is your current income monthly? and you want to break it from income. Then you can write What is your and then press alt+enter and enter the text in new line.