1
votes

I can't understand this behaviour in my app and I'm seriously thinking burn my mac NOW and start writing books of stories for children.

enter image description here

enter image description here

I have a normal Navigation Controller, and i push and pop viewcontrollers from it.

I'm doing a basic transition between views and I'm realising everything that I'm retaining or copying or whatever. But Instruments STILL identifies abandoned memory, and says that line is the responsible for that. I can't understand. What I'm forgetting? In Area2 I have few outles and one UIImageVIew, do I need to realising them to, in some way?

One more thing, if use Leaks inspector that same line is identified as a leak.. Really, I'm capable to destroy de entire world!

Please, can someone help me and tell me what I'm doing wrong and / or forgettting?

( Iniatly I had self.navigationController instead of delegate.navigationController, but the problems occurs to! )

Just this:


    #import 

    @interface Area2 : UIViewController
    {
        IBOutlet UIButton * btBack;
    }

    # pragma mark - Navigation Controller
    - (IBAction)goBack:(id)sender;
    - (IBAction)goGaleria:(id)sender;

When I do Analyze ( Menu: "Product"->"Analyze" Xcode 4.2 ) give me build succeeded!

UPDATE:

SOLUTION is in the replies at @mit3z's answer! @babbidi answer!

1
try static analyzer, Menu: "Product"->"Analyze" Xcode 4.2 - Saurabh Passolia
If you need to see where retains, releases and autoreleases occur for an object use instruments: Run in instruments, in Allocations set "Record reference counts" on on (you have to stop recording to set the option). - zaph
Stupid question, but do you retain a view controller that you queried from a navigation controller somewhere else? - DarkDust
@DarkDust Sorry I didn't understand your question! - Fábio Azevedo

1 Answers

1
votes

If you have your outlets as properties and you don't release them in dealloc - then yes, you'll get a leak. It's hard to tell without seeing Area2 @interface declaration.