Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
2290
How customViews are managed in memory
posted

Hi Steven,


I was wondering how custom monthViewDay views are managed in a memory? 

When are they discarded? Are they being reused?

In my app I just create a new view when monthViewDayCustomViewFor is called.

-(UIView*)calView:(IGCalendarView*)calView monthViewDayCustomViewFor:(NSInteger)month day:(NSInteger)day year:(NSInteger)year;

my code never breaks in Dispose of those views, so I wanted to know a little more on how they are managed.

thank you

Mark

  • 40030
    Offline posted

    Hi Mark, 

    The view is added as a subView, to our MonthViewDay view. However, that class also is holding a strong reference. Looking back, there isn't actually a need to keep a strong reference. Which may be causing the issue you're seeing.

    Once a that MonthDayView is used to represent another day, we release the reference of the custom view, and request another one via the delegate method, and then store the reference to that. 

    So, I would expect that as you scroll other months into view, the original custom view's should be released. 

    -SteveZ