I am working on an iPhone application using Xcode.
I have created a view controller that contains a textview where I hope the user will be able to enter text that can be saved.
As of right now, this is the code I have for this view controller.
-(void)viewDidLoad
{
[super viewDidLoad];
self.navigationItem.title = @"Notes";
self.navigationItem.rightBarButtonItem = self.editButtonItem;
}
-(void)viewWillAppear:(BOOL)animated{
self.notesText.text = _notesText.text;
}
-(void)setEditing:(BOOL)editing animated:(BOOL)animated
{
[super setEditing:editing animated:animated];
self.notesText.editable = editing;
[self.navigationItem setHidesBackButton:editing animated:YES];
if (!editing) {
_notesText.text = self.notesText.text;
}
The code that you see allows me to save the data but only if the applications stays opened. I can save text and the data will appear and show if the application stays opened. If I save text and close the app, when I open the app again the data does not appear, so Im assuming its not saving it.
Does anybody know why this is happening. What should I change or add?
Any help would be appreciated!