NSTextField and NSAttributedString

I'm trying to put an attributed string in to an NSTextField the user creates in their document. I cannot use an NSTextView. The problem is once the textfield is created attributes cannot be edited. Also I work in Objective-c because reasons.

So when the field is created this is the code used:

        [attribDict setObject:[self.editor.delegate foregroundColor] forKey:NSForegroundColorAttributeName];
        [attribDict setObject:aFont forKey:NSFontAttributeName];
        [attribDict setObject:[self.editor.delegate backgroundColor] forKey:NSBackgroundColorAttributeName];
        [attribDict setObject:self.editor.delegate.strokeColor forKey:NSStrokeColorAttributeName];
        [attribDict setObject:[NSNumber numberWithInt:-self.editor.delegate.strokeWidth] forKey:NSStrokeWidthAttributeName];

This part works if I set all the attributes before I create the textfield. But I need to be able to edit attributes on the string. For that I use this code:

        NSFont * aFont = [NSFont fontWithName:self.delegate.fontSelectorButton.title size:self.delegate.fontSize.intValue];
        NSMutableDictionary * attribDict = [[NSMutableDictionary alloc]init];
        [attribDict setObject:[self.delegate foregroundColor] forKey:NSForegroundColorAttributeName];
        [attribDict setObject:aFont forKey:NSFontAttributeName];
        [attribDict setObject:[self.delegate backgroundColor] forKey:NSBackgroundColorAttributeName];
        [attribDict setObject:self.delegate.strokeColor forKey:NSStrokeColorAttributeName];
        [attribDict setObject:[NSNumber numberWithInt:self.delegate.strokeWidth] forKey:NSStrokeWidthAttributeName];
        [textShape updateTextAttributesFromDictionary:attribDict];

And finally this is called the change the string attributes:

-(void)updateTextAttributesFromDictionary:(NSDictionary*)attribs
{
    self.stringAttributes = attribs;
    NSMutableAttributedString * as = [[NSMutableAttributedString alloc]initWithAttributedString:self.myTextField.attributedStringValue];
    [as beginEditing];
    [as setAttributes:attribs range:NSMakeRange(0, as.length)];
    [as endEditing];
    self.myTextField.attributedStringValue = as;
    
}

I have tried just setting the new attributes and get nothing. The above code however gives me wildly unpredictable results. Sometimes the NSTextfield gets a background color that cannot be altered. Sometimes the text vanishes. Sometimes all attributes are lost, sometimes if I include a stroke color and width I get the stroke but no fill. That's the most common. Is there some fundimental NSTextField short coming I'm missing? Is there something I'm missing with NSAttributedString? Are NSAttributedStrings not compatible with NSTextField?

NSTextField and NSAttributedString
 
 
Q