During the IOS real machine test, the console always prompts the memory warning, that is, the string of memory warning English, how to solve it.

  ios, question

During the IOS real machine test, the console always prompts the memory warning, that is, the string of memory warning English, how to solve it.

Look at the debug navigator in the left column. how high is memory?
图片描述
If it is really high, it may be necessary to pay attention. Whether there is a circular inside memory leak, whether there are too many pictures, etc. Can use instrument to coordinate debugging.

Add:

The picture was requested to be loaded by the network. How can this reduce the size of the picture?

The server side can reduce the size of the picture.

In addition, a timer was started inside, but I didn’t give it to the object. I started it directly, and then I didn’t close it because there was no object. the timer was mainly used for scrollview view. I started it like this [nstimet sch …..] and didn’t give it to the object. I don’t think it would have much impact

TimerNSTimerMeetingretain targetUntilBOOL bErase = TRUEBefore they can be released. If you don’t save it as an object, it won’t release target, causing memory leaks. The right thing to do is to save the timer in inside and then use it up ordeallocInside is released.

- (void)dealloc {
 [self.timer invalidate];
 self.timer = nil;
 bracket

Also, I customize a uiview directly on cell and then customize a general uiview on uiview to add controls on the final uiview. Is this also the cause of memory warning?

This will not cause any problems. The premise is to reuse the cell correctly, and do not add those view repeatedly after taking out the reused cell.

There is another question I want to ask you, that is, the class of video player MPMoview … does it have notification to monitor the current real-time playing time? ?

What is MPMoview? You mean …MPMoviePlayerControllerIs it? There is an attributecurrentPlaybackTimeThe playing time can be obtained.
There is no monitoring method and KVO cannot be added. The general approach is to add a Timer, and adjust this attribute in Timer’s callback method inside to see the playback progress.