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. Thanks in advance! The following code must be leaked (assuming the memory model of copy or staying on property TableContent): The setter of the table content will issue the old value and maintain / copy the new value. Consider a statement like: Your code (as it seems strange) should be like the following: Or - Need to use an autoreleased object that wants to avoid some devs where Self.tableContent = tempArr; [TempArr release]; - (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; }}
Saving content = [[NSMUTABELARRAR] INST];
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.
self-pressurized content = [[NSMUTABARARRARAL] INST]; [Voluntary release];
self.tableContent = [[[NSMutableArray Alloc] init] autorelease]; Or <->
Comments
Post a Comment