Re: Subclassing NSDateFormatter problem
Re: Subclassing NSDateFormatter problem
- Subject: Re: Subclassing NSDateFormatter problem
- From: Frederick Cheung <email@hidden>
- Date: Mon, 20 Sep 2004 17:49:02 +0200
On 20 Sep 2004, at 17:44, Luca Torella wrote:
Hi,
I subclassed NSDateFormatter since I had the following problem. I've
got a table view where an user can insert in one specific column time.
Not clock time but duration time. For example 1:12:13 means 1 hr 12
min and 13 sec. And until that no problems since I could use a simply
nsdateformatter instance. But I'd like that when the user digit 1:23
it means 0:1:23, not 1:23:0 like the normal formatter does.
I've attached the code of the subclass. When I run the code I take the
following error:
-[NSCalendarDate length]: selector not recognized
Do you know where's the problem?
[snip]
- (NSString *)stringForObjectValue:(id)anObject
{
if (![anObject isKindOfClass:[NSCalendarDate class]]) {
return nil;
}
return anObject;
}
returning an NSCalendarDate when you should be returning an NSString
probably isn't a good idea.
Fred
_______________________________________________
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