Re: Debugging NSTextField categories
Re: Debugging NSTextField categories
- Subject: Re: Debugging NSTextField categories
- From: Mark Dawson <email@hidden>
- Date: Fri, 13 May 2005 19:03:51 -0700
Arrgh. There was one path through
getObjectValue for the formatter that I missed in my code. My formatter wasn't handling a floating point case correctly (1 turning into .9999999446 type thing).
I've added a category to NSTextField; it has worked fine for months. However, one text field that I added returns the previous value when that field's action is called. I'm not sure how to debug this. I DID double (triple) check that the correct outlet is attached to that text field. I DO have a formatter (mine) attached to the text field, but as far as I can tell, it is returning the correct string. I'm not sure how to debug "bad" NSTextField return values. Any suggestions would be appreciated
Here is the category code--when I step into "[self stringValue]", I see the previous value (i.e., the value before that was in the text field BEFORE I started typing and pressed the enter key)
x = [myNewTextOutletField readFieldAsDimension];
- (unsigned long)readFieldAsDimension
{
DimensionFormatter *aFormatter = [self formatter];
if (aFormatter && [aFormatter isMemberOfClass:[DimensionFormatter class]])
{
return [aFormatter readFormatValueAsDimension: [self stringValue]];
}
return 0; // error
}
_______________________________________________
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
_______________________________________________
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