Is it legal to use the well-known free memory code in ipad/iphone app? [closed]

雨燕双飞 提交于 2019-11-29 00:47:25

iOS manages its memory resources pretty well if you ask me. If you're having memory issues with your app you need to profile and identify what those memory issues are and optimise them.

Think of it from a user's perspective. Especially on multi-tasking capable iPhones/iPads (with 4.2). The user has apps in the background that he/she will want to go back to in some time. They open up your app - which nukes everything to make room for itself - and then they try to return to their other apps only to find they've been killed because your app killed them.

I wouldn't be too happy and would probably strongly reconsider using your app again in the future.

Apple will likely have the same opinion. Their job is make sure the users have the best experience possible, which is why they have rules and guidelines to start with.

Whether or not your app will be rejected, I have no idea (it should be, but I don't know if Apple will explicitly test for such behavior).

However, this is a horrible idea to start with and won't work anyway.

As Jasarien said, your application will be running in an environment where it may be sharing resources with other applications. It is a far better solution to optimize the memory use within your application -- to minimize memory use -- and make your app as system friendly as possible. Resources are scarce, use them sparingly.

However, the "allocate remaining memory" code is bogus. There is no guarantee that the free memory will be contiguous. It is quite likely that allocation will fail.

The real question is exactly why does your application use so much memory and what have you done to minimize it?

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!