Re: Programmatically adding an NSTextField to an NSTextView
Re: Programmatically adding an NSTextField to an NSTextView
- Subject: Re: Programmatically adding an NSTextField to an NSTextView
- From: Keith Bauer <email@hidden>
- Date: Sun, 9 Feb 2003 19:57:58 +1300
[textField removeFromSuperview];
[textView addSubview: textField];
[textField setFrame:cellFrame];
Well, I've solved my problem. The problem was the
removeFromSuperview call. If I remove that, everything works as
expected.
removeFromSuperview will release the view, so you will have to retain
it before hand and then release it after adding it to a different > view.
Good to know, but the view's retain count obviously never dropped to
zero, since it still existed and displayed correctly. The only thing
wrong was the exception that was being printed, and the inability to
edit the field:
*** NSRunStorage, _NSBlockNumberForIndex(): index (0) beyond array
bounds (0)
-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.