ios - Knowing when a view is going to be destroyed in UIView lifecycle -


i have uiview part of uipageviewcontroller. pass strong object view, , having problem releasing.

in past think used viewdidunload release strong objects, , dealloc called. deal never called because of strong objects.

what best way know icm uipageviewcontroller object not needed anymore. i.e. if view beside page user looking at, might come view. using viewwilldisappeart not work expect.

@interface dotourfloorplanviewcontroller : uiviewcontroller <uiscrollviewdelegate, doasyncimageviewdelegate> {     iboutlet doasyncimageview* _imageview;     iboutlet uiscrollview* _scrollview;      nsmutablearray* _beaconlabels;      uiview* _circle;     uiview* _centerdot;      dotour* _tour;     cgrect _zoomrect;      int _circlecenterx;     int _circlecentery;      bool _didzoomtolocation; }  @property (strong, nonatomic) dotour* tour; 

views aren't unloaded more, newer devices don't have quite such tight memory restrictions , there other optimisations. seems when view you're referring view controller, little confusing.

if view controller (vc) provided data can retain reference until it's destroyed. data should not retaining vc, or view. if have kind of observation / delegation link should weak prevent retain cycles.

in way data released when vc no longer required, i.e. when removed parent or presenter.

specifically core data , references nsmanagedobjects can system calling refreshobject:mergechanges: flag of no turn object fault , remove data memory. can when view did disappear.


Comments

Popular posts from this blog

Django REST Framework perform_create: You cannot call `.save()` after accessing `serializer.data` -

Why does Go error when trying to marshal this JSON? -