Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>wow, you posted your whole app! No offense intended but you need to learn how view controllers work. I strongly recommended digging into the Apple docs.</p> <p>You may have other issues but start with this. You should never sending <code>viewWillDisappear</code> explicitly. Your view controller will receive that message from the OS. You should make at least the following changes:</p> <pre><code>- (void) finishedEditing { // DON'T DO THIS // [self viewWillDisappear: YES]; // DO THIS contact.name = contactName.text; contact.mobile = [NSNumber numberWithFloat: [contactMobile.text floatValue]]; NSManagedObjectContext *context = contact.managedObjectContext; NSError *error = nil; [context save: &amp;error]; [self.navigationController popViewControllerAnimated:YES]; } </code></pre> <p>You should commit changes to the data model based on the appropriate user action or app trigger. Being notified that the view will disappear is not a good place to do that. Also, you should not pop the navigation controller stack from viewWillDisappear..</p> <p>So, all the stuff you did in <code>viewWillDisappear</code> shouldn't happen there.</p> <pre><code>- (void)viewWillDisappear:(BOOL)animated { // contact.name = contactName.text; // contact.mobile = [NSNumber numberWithFloat: [contactMobile.text floatValue]]; // NSManagedObjectContext *context = contact.managedObjectContext; // NSError *error = nil; // [context save: &amp;error]; // [self.navigationController popViewControllerAnimated: YES]; } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload