ios - Memory Leak in this short method -


What is the reason this tool is reporting all the leaks of this VC? I think this is the allocation, but I do not know why it is leaking. - (zero) loadviewcentant {switch (self contentview) {case 0: self.title = @ "title1"; [Self. Nanjing Atom BackbuttonTam release]; // Parameter Emmetor Memory Leak Self Navigation item. BackbuttonItem = [[[UIBarButtonItem alloc] initWithTitle: @ "Blood" Style: UIBarButtonItemStylePlain Target: Zero Action: Zero] AutoOriz]; [Table AddObject: @ "0"]; [Table content add object: @ "1 - 49"]; [Tablet addObject: @ "50 - 75"]; [Table content adobe: @ "76 - 89"]; [Tableboard addObject: @ "More than 89"]; break; Case 1: self.title = @ "Title 2"; [Self. Nanjing Atom BackbuttonTam release]; Self.navigationItem.backBarButtonItem = [[[UIBarButtonItem alloc] initWithTitle: @ "Resp. Rate" style: UIBarButtonItemStylePlain Goal: zero Action: Zero] AutoCare]; [Table AddObject: @ "0"]; [Tablet addObject: @ "1 - 5"]; [Table AddObject: @ "6 - 9"]; [Tableboard addObject: @ "More than 29"]; [Tablet addObject: @ "10 - 29"]; break; Default: Break; }}

Enter image details here

Thanks in advance!

The following code must be leaked (assuming the memory model of copy or staying on property TableContent):

  Saving content = [[NSMUTABELARRAR] INST];   

The setter of the table content will issue the old value and maintain / copy the new value. Consider a statement like:

  self.tableContent = [NSMutableArray array]; It is completely valid because [NSMutableArray array] is an autoreleased object, the use of after Self.tableContent only works after it because the table content continues with the setter The number of maintenance to keep the count increases.  

Your code (as it seems strange) should be like the following:

  self-pressurized content = [[NSMUTABARARRARAL] INST]; [Voluntary release];   

Or - Need to use an autoreleased object that wants to avoid some devs where

  self.tableContent = [[[NSMutableArray Alloc] init] autorelease]; Or <->  

Self.tableContent = tempArr; [TempArr release];

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -