views:

89

answers:

3

Hi All

Another memory question on iPhone - When running the leaks application I see a number of leaks get identified, but are caused by NSFoundation or similar, rather than my application code. Where my application name is mentioned, I have obviously resolved the leak.

I assume I can ignore these and that my app will be approved, or am I reading the data incorrectly?

Also - does the application have to have zero memory leaks before it is approved?

Cheers

A: 

Your application will get approved even with memory leaks (at least my buggy application did get approved).

hanno
Yeah, leaks or un-obvious crashes do not stop an app from getting approved. Otherwise so many of the apps wouldn't be on the store.
lostInTransit
+2  A: 

Memory leaks will not cause your application to be rejected unless they contribute to general instability - e.g. a leak while moving forwards/backwards between views will eventually cause your app to crash.

Thats said, there are few actual leaks in the SDK libraries so be sure to check the leak are not actually a result of something your code is doing.

Andrew Grant
I agree, it is very unlikely that NSFoundation is leaking.
Felix
+2  A: 

Any leaks that apple finds in testing of its own stuff will get fixed (and Apple does definitely test for leaks). The frameworks are not completely leak free, but it's dangerous to assume that a problem is in the frameworks. Here are a couple things to keep in mind:

(1) If you leak an object, the entire tree of objects hanging off it will also be reported as leaks. Suppose an object of class NSPrivateWhosit that you've never heard is leaked. Does that necessarily make it Apple's problem? No, it might be something used by an instance of NSPublicClass that you leaked.

(2) If an object is allocated in Foundation and passed to you, and you retain it, then you can leak it. The backtrace of the allocation doesn't matter. What matters is the backtrace of the unbalanced retain.

Ken