Memory management in IOS application - iphone

I am developing an IOS application and i will submit it the next week the Apple store. but i am not very good in memory management.
I would like to know what are the all tools that you use to remove all the memory erros ( leaks,...).
should i remove all the NSLogs before submit it to the store ?
What are the other things to take care before submit it to the store ?
thanks for your answers

Before submitting to the app store..
Detect all leaks, you can use
a) Leaks (xcode->instruments->leaks).
b) Static analyzer tools, if you are using newer versions of xcode (Build-> build and analyze).
c) Above all , make a thorough check yourselves, that you arereleasing all memory that you are allocing/retaining..
What the need of NSLog in a
distribution build. NSLog helps in
debug..Remove them all..
Run your app in whatever iphone
device you get..Never submit an
iphone app to store without checking
on device itself.
If your app crashed during review,
then it is surely rejected. Resolve
all bugs/crashes before submitting.
A good QC on device is a must.
This checklist might be helpful..

The static analyzer and the instruments will help you detect the leaks. Find and resolve them. Have a look at Memory management it will help to resolve leaks.

In Xcode , Instruments -> Leaks, is used basically to find out memory leaks.
Hope this helps you.

Related

Separate Applications for iPad1-2 and iPad3-4

Is it possible to restrict applications to only run in iPad3 and iPad4?
I have an application which has memory leak, most probably on iPad 1-2.
I want to restrict my application.
Answering to your question, that's not possible right now, you can restrict the version of iOS, but not the device.
About your problem, as other people is saying, fix your code because you are leaking somewhere, you get the risk of Apple rejecting it too.
The best way to check it is analysing your code (Product > Analyze), also run the Instruments (Product > Profile) and check the memory leaks.
The best option is fixing your leak.
If you still want to restrict usage of your application you can use the UIRequiredDeviceCapabilities list. add a capability in your plist called auto-focus-camera. This functionality is available starting the 3rd generation iPad.
Keep in mind that this is not the best option
Here is the capabilities list sorted by device

last steps before beta testing / submission to app store?

I'm a newbie. I've worked out all the bugs I can find in my app, but before I find beta testers and ultimately submit to the app store, I want to make sure I don't leave out any important steps. For example, I see several questions talking about checking for memory leaks, but I don't really know what that is or how to do it; same thing with the sandbox. I've already created a signing certificate and a provisioning profile and registered my device.
So: assuming that my code is all working, what else should I do or check for?
(If this isn't an appropriate stackoverflow.com question, I apologize; please let me know, and I'll remove it asap.)
Definitely check for leaks.
Leaks are where your app doesn't give up memory to the system after it has finished using it. This can mean (a) Your app uses more memory than it needs to and (2) the device runs out of memory if your app runs for a long time, and your app can crash and other apps will be closed.
Here's a guide to finding leaks, using a tool called Instruments that comes with Xcode.
http://mobileorchard.com/find-iphone-memory-leaks-a-leaks-tool-tutorial/
Also make sure you write 'review notes' for the reviewer if there's any aspect of your app that won't be immediately obvious. If you need a login to use the app, make sure you provide a test one in the review notes. Consider making a (private?) YouTube video showing the app in action.

Will an application be rejected from the App Store if Xcode shows warnings for it?

If I build my iPhone application and Xcode shows compile-time warnings, will it be rejected if I submit it to the App Store?
What types of warnings? Every warning you have can be fixed with proper coding.
I ask because while the warnings themselves may not get your app rejected, but crashing, bad memory management that results in the app eating up lots of memory and not releasing it (resulting in a crash eventually), or the app just not functioning as described will get it rejected.
Do you not want to fix the problems to ensure your app runs well, gets good ratings due to satisfied customers, and therefor sells well?
Apple is not gonna reject the application because of warning. But be sure that you haven't used any Private API. If possible remove the warning. It is not a difficult task for you. If you can develop application than why you can't make it warning free ?
These warnings won't show up when you use the app.
They are just hints of XCode to tell you that they could be problematic.
You only need to be sure that the warnings don't produce a crash. If so Apple will reject your App.

iPhone known memory leaks - list

Is there a list of known leaks within the iPhone SDK sitting somewhere, all alone?
I guess you would have it specified by version. (I just ran my test app - it has a leak outside the project itself (somewhere related to connections) when testing it on a v3.3.1 iPhone 3G, but the leak is not there using an iPhone 4 v4.0.2.).
It's doubtful that there's a public list of known memory leaks. If you want to know whether your leak is a known issue, your best bet is probably to search Open Radar, or to use Apple's Bug Reporter and see if you get a response.
During my short experience with the iPhone SDK, I have never encountered a memory leak caused really by the SDK. It is mostly caused by your code but has shown itself later.
It is also possible that the new SDK has improved some ways of doing things, so that your previous leaks do not occur anymore.
You need to give more details to the leak in order to help you.

iPhone: iPhone application testing

First, Thanks to all for your quick help for any questions asked in this forum.
I just want to know what are the testing tools coming up with Xcode on Mac as i need to test my iPhone application professionally (or) What do you suggest to use debug and test my application using any (or) built-in tools?
Thanks.
The first thing I try is Xcode's "Build and Analyze" menu command.
Next thing is to run Instruments and look for memory and object allocations and disposal. Instruments should keep you busy for quite a while as it can provide you a wealth of information, including network performance and graphics utilization.
When using instruments, the first method you should check is memory allocation and leaks. When your application leaks, it will spike. Click on this leak and then extend the details to find the exact whereabouts of the leak.
However read the documentation on it all first.
Documentation