hi i have set up a table view to display entires in a plist and have a section to add new data to the plist but i am unable to save the data... it stores fine and display fine but when i leave the app and reload the new data has gone here is how im saving
- (IBAction) save: (id) sender {
NSLog(@"%@", @"Save pressed!");
if (self.job != nil) {
// We're working with an existing drink, so let's remove
// it from the array and just recreate it like we would a new
// drink...
[jobArray_ removeObject:self.job];
self.job = nil; // This will release our reference and set the property to nil
}
// Create a new drink dictionary for the new values
NSMutableDictionary *newDrink = [[NSMutableDictionary alloc] init];
[newDrink setValue:self.nameTextField.text forKey:NAME_KEY];
[newDrink setValue:self.ingredientsTextView.text forKey:INGREDIENTS_KEY];
[newDrink setValue:self.directionsTextView.text forKey:DIRECTIONS_KEY];
// Add it to the master drink array and release our reference
[jobArray_ addObject:newDrink];
// Sort the array since we just added a new drink
NSSortDescriptor *nameSorter = [[NSSortDescriptor alloc] initWithKey:NAME_KEY ascending:YES selector:@selector(caseInsensitiveCompare:)];
[jobArray_ sortUsingDescriptors:[NSArray arrayWithObject:nameSorter]];
// Pop the modal view and go back to the list
[self dismissViewControllerAnimated:YES completion:NULL];
}
am i making a mistake for it not to save to the plist? it loads the data i preset in the plist but not the new entrys
thanks in advance