Wednesday, May 5, 2010

The analyzer and adding subviews: unrecognized selector sent to instance

I ran the analyzer on some code and found a 'leak'. I added a release and then stuff started to crash.  The problem is that the analyzer didn't realize that by adding my view as a subview resulted in a retain.   Adding a release caused the item to get released, and a crash.

I had made some other changes, so I didn't realize what was causing the problem.

The controller was being released, but I still needed to keep it around, because releasing it caused the view to be released.  I need to maintain a collection for the controllers anyway, so that will solve the problem.

No comments:

Post a Comment