4

i'm developing an iPhone project in which i enabled ARC, and when i run my project with instruments so many places it is showing 100% leak for ex:

-[self.navigationController pushViewController:secondPage animated:YES]; //100% leak

[self loadXML];//100% leak

even if i make secondPage object as nil after pushing and in viewDidUnload the leak docent get resolved. How can i solve these leaks?Any help is appreciated in advance.Thank You.

BoltClock
  • 700,868
  • 160
  • 1,392
  • 1,356
Univer
  • 325
  • 2
  • 6
  • 18
  • 2
    For trivia, see this question I asked: [What kind of leaks does Objective-C's automatic reference counting (in Xcode 4.2) not prevent/minimize?](http://stackoverflow.com/questions/6260256/what-kind-of-leaks-does-objective-cs-automatic-reference-counting-in-xcode-4-2) – BoltClock Dec 05 '11 at 10:31
  • 1
    You'll need to post some more code though. It's not clear at all what you're doing pushing these controllers or loading anything. – BoltClock Dec 05 '11 at 10:32
  • How do you know that the leak comes from -[self.navigationController pushViewController:secondPage animated:YES]; / – user4951 Jun 06 '12 at 04:40

1 Answers1

2

The Leaks instrument (in Instruments) will tell you exactly what was leaked, where it was created, record the stack, and (optionally) record every reference count operation. Learning to use it proficiently is highly recommended.

justin
  • 104,054
  • 14
  • 179
  • 226