 |
 |
Editing dates in table views
|
 |
|
 |
|
Mac Enthusiast
Join Date: Sep 2000
Location: Vermont, USA
Status:
Offline
|
|
Hi,
This should be an easy one to answer, I hope
I have a table view which has a column for dates. I formatted the column using a date formatter in my awakeFromNib; everything looks fine. When I double click to edit the date column and change the date from 9/02/03 to 9/23/03 I just get a system beep and the field stays in "editing mode". If I delete the entire date and hit return, it ends editing and then crashes.
Any suggestions?
|
|
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Nov 2000
Location: Tasmania, Australia
Status:
Offline
|
|
Sounds like it thinks 9/23/03 is not a valid date (which it's not in most countries). Can you post your formatter code here or otherwise just double check to make sure that it allows this date format?
|
|
|
| |
|
|
|
 |
|
 |
|
Forum Regular
Join Date: Aug 2003
Status:
Offline
|
|
9/23/03 is definitely a valid date format. Do you have the date formatter set to use that date format? That might be the problem.
|
|
-- Devin Lane, Cocoa Programmer
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Nov 2000
Location: Tasmania, Australia
Status:
Offline
|
|
Originally posted by Devin Lane:
9/23/03 is definitely a valid date format. Do you have the date formatter set to use that date format? That might be the problem.
Being a valid date depends on what the date format is for that text object's formatter.
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Enthusiast
Join Date: Sep 2000
Location: Vermont, USA
Status:
Offline
|
|
I use the users short date format from System Prefs so I think the 9/23/03 is a valid date, because it populates the column with dates in that format.
Here is the code that I use to format the table column cell:
NSDateFormatter *dateFormat = [[[NSDateFormatter alloc] initWithDateFormat:
[[NSUserDefaults standardUserDefaults] objectForKey:NSShortDateFormatString]
allowNaturalLanguage:NO] autorelease];
[[[tableView tableColumnWithIdentifier:dateColumn] dataCell] setFormatter:dateFormat];
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |