Re: Leak in "navigation based application" iPhone template
Re: Leak in "navigation based application" iPhone template
- Subject: Re: Leak in "navigation based application" iPhone template
- From: "Hamish Allan" <email@hidden>
- Date: Fri, 28 Nov 2008 12:22:21 +0000
Hi,
As you familiarise yourself with the design of the UITableView, you'll
discover that NSIndexPath objects are passed every time a row needs to
be described, which is (often several times) each time a row comes
into view. In other words, they're used a lot. So the designers of
NSIndexPath will almost certainly have used singletons for certain
common paths (e.g. [0,0]) so that objects don't have to be created and
destroyed each time such a path needs to be described. In other words,
if you're seeing objects allocated and not deallocated, but only when
you first run the program, and the "leak" doesn't get any worse as you
keep running it, you're probably seeing singletons.
Also, you're best off asking questions like this on the Cocoa-dev list
rather than the XCode-users list, because it doesn't really relate to
the XCode tools, except insofar as that you use them to write Cocoa
code.
Best wishes,
Hamish
On Fri, Nov 28, 2008 at 2:28 AM, Martin Cote <email@hidden> wrote:
> Hi,
> I'm playing with the iPhone UITableView and I started a project with the
> "navigation based application" template. For testing, I modified the
> tableView:numberOfRowsInSection: function to return 2 instead of 0. If I
> monitor this application with Instruments, it detects a leak if I let it run
> for a few seconds (without any interaction). The leak is a NSIndexPath
> object.
> The tableView:cellForRowAtIndexPath: function seems to be the culprit, but
> I'm simply unable to find the source of the leak. Did anyone noticed a
> similar problem?
> Regards,
> Martin Cote
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Xcode-users mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden