50pixels/FPPopover — pull request #23 by raja-baz (2012-12-11 23:17:01+00:00)
Title: Memory leak and layout bugfixes

I made two commits. They are pretty straightforward.

The first one(by far the more important one) fixes a memory leak caused by a retain cycle because a block contained a reference to the self object.

Essentially, FPPopoverController was sending a block to FPTouchView. This block contained a reference to the controller therefore the FPTouchView now has a retained reference to FPPopoverController. Also, FPPopoverController has a retained reference to FPTouchView therefore we have a cycle and neither of these ever gets released. The fix is simple, see here:
http://stackoverflow.com/questions/4352561/retain-cycle-on-self-with-blocks

The second commit fixes a personal problem I had with the library behaving unexpectedly(but that may be your expected behaviour so feel free not to pull this one). Basically when I specify contentSize on a popOver I expect that size to be the size of the contentView inside it, not the size of the whole thing. However, the size of the actual content was (contentSize - arrowHeight - border). Now, border is fine, it's easy to compensate for by the user of the library as it's predictable but arrowHeight depends on the direction of the arrow and is therefore unpredictable by the user of the library.

Basically, the size of the content of the popover is now predictably derived from contentSize.