Programmatically adding an NSTextField to an NSTextView
Programmatically adding an NSTextField to an NSTextView
- Subject: Programmatically adding an NSTextField to an NSTextView
- From: Keith Bauer <email@hidden>
- Date: Thu, 6 Feb 2003 21:05:44 +1300
I have an NSTextField which I'm adding to an NSTextView like this:
[textField removeFromSuperview];
[textView addSubview: textField];
[textField setFrame:cellFrame];
The NSTextField's text is set when it's created like this:
[textField setStringValue:text];
[textField sizeToFit];
However, when I click on the text field in my window, I get this
message printed to the console:
*** NSRunStorage, _NSBlockNumberForIndex(): index (0) beyond array
bounds (0)
... and I'm unable to edit the field.
If I remove the call to setStringValue:, I don't get the exception, but
I still don't get to edit the field either...
I've seen errors like this come up before in the list archives, but
I've been unable to find any solutions, or even any advice that seems
relevant :(
Can anyone think of anything I might be doing wrong? Is it just not
possible to add NSTextFields to NSTextViews or something?
Thanks,
Keith
_______________________________________________
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.