Issues with map behind UIView, similar to FourSqua

2019-07-02 01:04发布

I am currently using this excellent solution from @yonel to make something similar to the FourSquare venue detail page. Within my storyboard I have this:

enter image description here

The problem is: because the scroll is a bit laggy, when I scroll fast I get a "Received memory warning." message in my console. The curious thing is that if I remove all of the labels and buttons inside the UIView (just below the Map View), everything works fine.

Any idea what could be wrong?

4条回答
狗以群分
2楼-- · 2019-07-02 01:25

I'm not familiar with the Venue Detail view in Foursquare, however I don't think we can help you with this without seeing some code.

At a glance, I notice there's another view there you haven't expanded. Perhaps something heavy in there, but again I think you need to show some code for those views, cause its more likely you're performing some memory intensive task and that's causing the issue.

Preferably if you could the scrollViewDidScroll method too :) I'll do my best to take a look once you've posted something. Or you can contact me directly with sample code if you don't want to post it here publicly.

查看更多
我想做一个坏孩纸
3楼-- · 2019-07-02 01:28

Unfortunately after days of searching, I could not find a solution. But I managed to find something to replace what I have, using UITableView.

I found this ParallelView for UITableView: https://github.com/zhigang1992/ZGParallelView

Thanks for all the answers.

查看更多
家丑人穷心不美
4楼-- · 2019-07-02 01:42

Received memory warning ,this warning displayed in the console once when i was testing in device .But when I closed the idle apps the error went away.So try removing apps running in background and try again .If it exist I think the issue is that when you use the scroll some kind of memory leak from the map tiles or something. Use instruments and analyse if there is some memory leaks.

This may help you

memory-management-in-objective-c-tutorial

查看更多
一夜七次
5楼-- · 2019-07-02 01:48

As the above posters mentioned, it is difficult to give you any authoritative information without actually seeing some code for your project - and I'm aware that you have already found a workable solution. However, in case other users find this question with similar responses:

The nature of the error message suggests that you probably had some kind of memory leak in your application. The best way to start debugging this kind of problem is to use the Memory analysis tools found in Instruments.app. For some detailed information on how to do this, take a look at this link from the Apple Developer site.

Especially if some of the items which are scrolling on or off the screen have graphical information (background images, etc) associated with them - destroying things which are off-screen might help improve performance. You will, of course, then have to re-create the items in question when they come back on-screen.

If the above doesn't help, take a look at some of the following questions/answers, which provide insight into other problems where this error occurs. Perhaps your issue is/was related:

查看更多
登录 后发表回答