read text file with delimiter nsstring
<p>I have a text file like this</p>

<p>question1
question2
question3</p>

<p>I want to read only the first line into a nsstring</p>

<p>after that I want to mark the first line so the next time, skip the first line, but I don't know how to do it, I have this code for read but give me only the third line</p>

<pre><code>NSString *filePath = [[NSBundle mainBundle] pathForResource:@"qa" ofType:@"txt"];  

NSString *myText = [NSString  stringWithContentsOfFile:filePath encoding:NSUTF8StringEncoding error:nil];   
NSArray *lines = [myText componentsSeparatedByString:@"\n"];    
for(myText in lines)
{

    texview.text = myText;  

}


}  
</code></pre>

<p>Ok I try this code, Do not work, what I am Doing wrong?</p>

<pre><code>NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSString * const kKey = @"OneTimeKey";
NSObject  *keyValue = [defaults  objectForKey:kKey];



NSString *filePath = [[NSBundle mainBundle] pathForResource:@"qa" ofType:@"txt"];  

NSString *myText = [NSString  stringWithContentsOfFile:filePath encoding:NSUTF8StringEncoding error:nil];   
NSArray *lines = [myText componentsSeparatedByString:@"|"];    



if (keyValue==nil) {
    for(myText in lines)

    {

        preguntadia.text = myText;  

        [defaults setBool:YES forKey:kKey];

    }



}
</code></pre>
