ios - Core Data memory leak when I use UINavigationController -


i used xcode template create master-detail app , using core data. check app instruments (memory leaks) , see memory leaks when go detail view master view.

memory leaks appear when i:

  1. select row in table , go master view detail view
  2. edit value , click button clicksave in detailview
  3. click on button in uinavigationcontroller

my code:

masterviewcontroller.m: @implementation masterviewcontroller ..... - (void)prepareforsegue:(uistoryboardsegue *)segue sender:(id)sender  {     if ([[segue identifier] isequaltostring:@"showdetail"]) {         nsindexpath *indexpath = [self.tableview indexpathforselectedrow];         event *object = [[self fetchedresultscontroller] objectatindexpath:indexpath];         [[segue destinationviewcontroller] setdetailitem:object];     } }  detailviewcontroller.h: #import <uikit/uikit.h> #import "event.h"  @interface detailviewcontroller : uiviewcontroller <uitextviewdelegate>  @property (strong, nonatomic) event *detailitem;  @end   detailviewcontroller.m: - (ibaction)clicksave:(id)sender {      self.detailitem.mytext = self.textview.text;      nserror *error;     if (![self.detailitem.managedobjectcontext save:&error]) {          nslog(@"unresolved error %@, %@", error, [error userinfo]);         abort();     } } 


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -