Re: NSDatePicker leaking in graphical mode?
Re: NSDatePicker leaking in graphical mode?
- Subject: Re: NSDatePicker leaking in graphical mode?
- From: Matt Neuburg <email@hidden>
- Date: Sun, 16 Jul 2006 10:02:26 -0700
- Thread-topic: NSDatePicker leaking in graphical mode?
On Sun, 16 Jul 2006 17:18:39 +0200, Oliver Quas <email@hidden> said:
>Hi list,
>
>i have a strange behaviour when using a NSDatePicker in my application.
>
>The NSDatePicker instance is set to the graphical view without time
>selection, to get a calendar view as seen in iPhoto on the bottom left.
>
>when i programmatically set
>
>[myDatePicker setCalendar:[[NSCalendar currentCalendar] autorelease]];
>[myDatePicker setDate:(NSDate *)[NSCalendarDate calendarDate]];
>[myDatePicker setDelegate:self; // self is an instance of the default
>document class MyDocument
>
>( assumed there is an IBOutlet connected to the NSDatePicker named
>"myDatePicker" )
>
>the NSDatePicker is leaking like hell.
>
>Proof: If i comment out those lines, everything get's back to normal.
>no leaks.
>
>In my application, the view that contains the NSDatePicker is
>programmatically added to a NSSplitView. Once the NSAnimation starts
>to 'move-in' the view, the number of leaks increase. Even when i
>manually drag the NSSplitView divider, the number increases.
>It seems to me, there is a bug in NSDatePicker (and also in its cell
>class): every time the NSDatePicker needs display, it tries to set
>the date values on its cells. I guess they somehow retain the
>previous date value without releasing it.
>
>Has anyone else recognized this? And is there anything i can do to
>prevent this issue?
>
>I use the latest release of Xcode (version 2.3). The application is a
>universal binary and my development machine is PowerPC based.
>
>Thanks in advance,
>
>
>Oliver
>
>Hi list,
>
>i have a strange behaviour when using a NSDatePicker in my application.
>
>The NSDatePicker instance is set to the graphical view without time
>selection, to get a calendar view as seen in iPhoto on the bottom left.
>
>when i programmatically set
>
>[myDatePicker setCalendar:[[NSCalendar currentCalendar] autorelease]];
>[myDatePicker setDate:(NSDate *)[NSCalendarDate calendarDate]];
>[myDatePicker setDelegate:self; // self is an instance of the default
>document class MyDocument
>
>( assumed there is an IBOutlet connected to the NSDatePicker named
>"myDatePicker" )
>
>the NSDatePicker is leaking like hell.
>
>Proof: If i comment out those lines, everything get's back to normal.
>no leaks.
Leaks what, and what's your evidence that it's a leak? (Remember, a lot of
harmless caching goes on in Cocoa.) Can you provide instructions for easily
reproducing the phenomenon? I created an example in which my code sets
myDatePicker to [NSDate date], where myDatePicker is an ivar to which an
NSDatePicker in graphical mode is bound, and there were no leaks as measured
using ObjectAlloc. m.
--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
<http://www.amazon.com/gp/product/0596102119>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden