Re: Custom Cell with Image & Text + OutlineView + Bindings Problem
Re: Custom Cell with Image & Text + OutlineView + Bindings Problem
- Subject: Re: Custom Cell with Image & Text + OutlineView + Bindings Problem
- From: Thilo Ettelt <email@hidden>
- Date: Fri, 10 Mar 2006 11:44:42 +0100
Thank you, now it displays the correct value in the fieldeditor, but
I'm still stuck with setting the value.
I've tried using "- (BOOL)getObjectValue:(id *)obj forString:
(NSString *)string errorDescription:(NSString **)error" but I'm not
sure how to handle this method since my arrayController won't notice
a change of that object because I will only be changed for my
subclassed cell, but not for my corresponding arraycontroller. How
can I get informed of the change?
Also this:
- (NSText *)setUpFieldEditorAttributes:(NSText *)textObj {
[textObj setFont:[NSFont systemFontOfSize:[NSFont
smallSystemFontSize]];
return textObj;
}
(retyped- possible typos were not in code)
is a good idea- i thought- for changing the fieldeditors' font, but
this doesn't seem to work. Is there any way to archieve it anyway?
Thanks in advance,
Thilo
Am 10.03.2006 um 03:03 schrieb Corbin Dunn:
On Mar 9, 2006, at 2:40 AM, Thilo Ettelt wrote:
Hello,
I can't find a solution for the following problem I'm facing:
I've got a NSTextCell subclass whose objectValue is being set
through a binding on the tablecolumn of a NSOutlineView.My
subclassed textcell draws a color rectangle and the appropriate
text by using the objectValue's -valueForKey: method (the
objectValue is a custom object having 2 values: color and title-
and it's binded to a treeController).
So far so good, but now I want to make this cell editable. As soon
as I doubleclick on it the selected, editable text is the pointer
to the objectvalue and I can't find a way to change that. I
actually need the -valueForKey:@"title" from the objectValue
object. But how?
Does anyone have an idea how to handle this?
You could have a custom formatter that implements:
- (NSString *)editingStringForObjectValue:(id)obj;
and returns what you want.
--corbin
_______________________________________________
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