I\'m trying to create an app which plays videos from a file using AVFoundation
. The videos are shown in a view accessed by tapping on a row in a parent tableview.
May be you leave your videoView retained in some place? Because if you do, your avPlayerItem and avPlayer stay alive and according to this topic you came up to iOS limitation for "render pipeline" with 4 videos staying in memory.
Remember that setting var to nil does not actually release underlying object. So your
videoView = nil;
can have zero effect.
You should remove from superview first as it will reduce the retain count by 1 and ARC will take care of the release for your code.
like this
[videoView removeFromSuperview];
[self setVideoView:nil];