Custom Field Editors
Custom Field Editors
- Subject: Custom Field Editors
- From: Andrew <email@hidden>
- Date: Mon, 2 Aug 2004 20:13:27 +0300
Hi,
I am trying to use a custom field editor for my cell but am having
difficulties. I've tried to make a simple app to isolate the problem.
I have one window with an NSTableView in it with one column. The cells
it uses are of the type MyTextFieldCell which inherits from
NSTextFieldCell. MyTextFieldCell has a class method fieldEditor...
+ (NSTextView *)fieldEditor {
static NSTextView *secretFieldEditor = NULL;
if (secretFieldEditor == NULL) {
secretFieldEditor = [[NSTextView alloc] init];
[secretFieldEditor setFieldEditor: YES];
[secretFieldEditor setUsesFontPanel: NO];
[secretFieldEditor setUsesRuler: NO];
[secretFieldEditor setUsesFindPanel: NO];
}
return secretFieldEditor;
}
Then I have overridden setUpFieldEditorAttributes...
- (NSText *)setUpFieldEditorAttributes:(NSText *)textObj {
NSText *fieldEditor;
fieldEditor = [MyTextFieldCell fieldEditor];
fieldEditor = [super setUpFieldEditorAttributes: fieldEditor];
// do I need to do this?
[fieldEditor setDelegate: self];
return fieldEditor;
}
When I run my test app and try to edit the contents of a cell the field
editor appears (though it doesn't look quite right - more like a white
rectangle - can't quite say what's wrong with its appearance). When I
type into the editor however no text appears. None of my delegate
functions get called. Randomly the app dies with sig 10.
Would someone give me a few hints? I've read all the docs I can find
but perhaps I'm missing the obvious...
Thanks,
Andrew
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.