Hello,
I am HappyDungcicle. Happy Dungcicle is confused. How does Happy Dungcicle find an easy way to add text to the end (or to the middle) of a text file? Happy Dungcicle keeps his/her/its text file in the "MainBundle" (I think?). Here is the code I have that works that reads and displays the text file:
Happy Dungcicle would like to be able to add text to the end of this text file, without erasing the text that is already there. How does Happy Dungcicle do this? Happy Dungcicle is good at programming other languages but not Iphone. So precise code would be very helpful.
I am HappyDungcicle. Happy Dungcicle is confused. How does Happy Dungcicle find an easy way to add text to the end (or to the middle) of a text file? Happy Dungcicle keeps his/her/its text file in the "MainBundle" (I think?). Here is the code I have that works that reads and displays the text file:
Code:
- (void)viewDidLoad {
[super viewDidLoad];
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"Tacos"ofType:@"txt"];
if (filePath)
{
NSString *textFromFile = [NSString stringWithContentsOfFile:filePath];
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Help Message"
message:textFromFile
delegate:self
cancelButtonTitle:@"OK"
otherButtonTitles: nil];
[alert show];
[alert release];
}
}
Happy Dungcicle would like to be able to add text to the end of this text file, without erasing the text that is already there. How does Happy Dungcicle do this? Happy Dungcicle is good at programming other languages but not Iphone. So precise code would be very helpful.