My friends and I are doing a project for one of our classes, it didn't seem to difficult but none of us know how to code effectively.
Basically our project will get the file path from three text files within the bundle. From the files we will randomly pull one line from each file. From these we will make random sentences that will generally be crazy.
We've researched a but we're still a bit confused. This is what we've got so far:
from here we aren't too sure about to go from here. Any tips or help would be greatly appreciated.
Basically our project will get the file path from three text files within the bundle. From the files we will randomly pull one line from each file. From these we will make random sentences that will generally be crazy.
We've researched a but we're still a bit confused. This is what we've got so far:
Code:
- (IBAction)displayRandom
{
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"sample" ofType:@"txt"];
if (filePath) {
NSString *myText = [NSString stringWithContentsOfFile:filePath];
if (myText) {
ftext.text= myText;
}
}
from here we aren't too sure about to go from here. Any tips or help would be greatly appreciated.