ios - Crash on master/detail app, when changing category, after releasing Var -


i'm struggling figure out why app crashing when release synthesized properties. app launches, , when tap on row, takes me detailviewcontroller, when go , tap row again app crashes exc_bad_access.

detailviewcontroller.h:

#import <uikit/uikit.h>  @interface detailviewcontroller : uiviewcontroller {      iboutlet uilabel *clipboardlabel;  }  @property (nonatomic, retain) iboutlet uilabel *clipboardlabel;  @end 

detailviewcontroller.m

#import "detailviewcontroller.h"  @implementation detailviewcontroller  @synthesize clipboardlabel;  - (void)viewdidload {         // additional setup after loading view nib.     clipboardlabel.text = @"tap image copy";     [super viewdidload]; }  - (void)dealloc {     [clipboardlabel dealloc];         [super dealloc]; }  @end 

call release instead of dealloc on clipboardlabel in dealloc method.

that should :

- (void)dealloc {     [clipboardlabel release];         [super dealloc]; } 

a general rule : 1 should never call deallocon object.


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -