[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Problem with NSDateFormatter
From: |
Fred Kiefer |
Subject: |
Re: Problem with NSDateFormatter |
Date: |
Tue, 24 Aug 2010 01:06:56 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; de; rv:1.9.1.11) Gecko/20100714 SUSE/3.0.6 Thunderbird/3.0.6 |
Am 24.08.2010 00:16, schrieb Fred Kiefer:
> Am 23.08.2010 15:20, schrieb Philippe Roussel:
>> In SimpleAgenda I use an instance of NSDateFormatter created with
>>
>> dateFormatter = AUTORELEASE([[NSDateFormatter alloc]
>> initWithDateFormat:[[NSUserDefaults standardUserDefaults]
>> objectForKey:NSShortDateFormatString] allowNaturalLanguage:NO]);
>>
>> in the appointment editor for a textbox where you can enter the last
>> date of a recurring event. I *think* it used to work but with latest svn
>> I'm unable to change the date and the textbox has a really strange
>> behaviour.
>>
>> I'm using a French locale but the problem exists in English too.
>>
>> Is my code wrong or is this a bug in NSDateFormatter ?
>> Did someone recently tested that code ?
>
> I was able to reproduce a problem here (probably with an older version
> of SimpleAgenda). Could you please write a detailed bug report. I am
> going to look into this in the next days and it would be great to have a
> place where we gather all relevant information.
My first impression when looking at a back trace from the code is that
[NSCell setObjectValue:] gets called too often. I would expect that we
only get that call, when the editor actually finished editing the text.
But I get it each time I delete a character from the string.
I still don't understand whether this is actually wrong and if so, where
it goes wrong. Perhaps it is just too late over here. :-(
Breakpoint 1, -[NSCell setObjectValue:] (self=0xe007a0,
_cmd=0x7ffff78108a0,
object=0xcde270) at NSCell.m:331
331 {
(gdb) po object
29.09.2010
(gdb) bt
#0 -[NSCell setObjectValue:] (self=0xe007a0, _cmd=0x7ffff78108a0,
object=0xcde270)
at NSCell.m:331
#1 0x00007ffff7384577 in -[NSActionCell setObjectValue:] (self=0xe007a0,
_cmd=<value optimized out>, anObject=0xcde270) at NSActionCell.m:228
#2 0x00007ffff74d70cf in -[NSTextField validateEditing] (self=<value
optimized out>,
_cmd=<value optimized out>) at NSTextField.m:485
#3 0x00007ffff738415f in -[NSActionCell objectValue] (self=0xe007a0,
_cmd=<value optimized out>) at NSActionCell.m:153
#4 0x000000000040d0aa in -[AppointmentEditor controlTextDidChange:]
(self=0xd70210,
_cmd=<value optimized out>, aNotification=<value optimized out>)
at AppointmentEditor.m:169
#5 0x00007ffff6d5fb03 in -[NSNotificationCenter _postAndRelease:]
(self=0x6dc210,
_cmd=<value optimized out>, notification=0x800020) at
NSNotificationCenter.m:1161
#6 0x00007ffff73f64bc in -[NSControl textDidChange:] (self=0xc95d30,
_cmd=<value optimized out>, aNotification=0x875a10) at NSControl.m:577
#7 0x00007ffff74d796c in -[NSTextField textDidChange:] (self=0xc95d30,
_cmd=<value optimized out>, aNotification=0x875a10) at NSTextField.m:522
#8 0x00007ffff6d5fb03 in -[NSNotificationCenter _postAndRelease:]
(self=0x6dc210,
_cmd=<value optimized out>, notification=0x875a10) at
NSNotificationCenter.m:1161
#9 0x00007ffff754f0db in -[NSTextView didChangeText] (self=0x802e30,
_cmd=<value optimized out>) at NSTextView.m:2659
#10 0x00007ffff7436c5a in -[NSInputManager handleKeyboardEvents:client:]
(self=0x92c530,
_cmd=<value optimized out>, eventArray=<value optimized out>,
client=0x802e30)
at NSInputManager.m:652
#11 0x00007ffff7555a13 in -[NSTextView(leftovers) keyDown:] (self=0x802e30,
_cmd=<value optimized out>, theEvent=0xaf72f0) at NSTextView.m:5392
---Type <return> to continue, or q <return> to quit---
#12 0x00007ffff73a0578 in -[NSApplication run] (self=0x930e00,
_cmd=<value optimized out>)
at NSApplication.m:1532
#13 0x00007ffff7380857 in NSApplicationMain (argc=<value optimized out>,
argv=<value optimized out>) at Functions.m:89