CPTextView error.

28 views
Skip to first unread message

Todd Freese

unread,
Oct 25, 2016, 6:55:35 PM10/25/16
to Cappuccino & Objective-J
Loving the new CPTextView. But I am having one problem.

My CPTextView is setup in a nib. It is not editable or selectable. I set the font and text color via this code:

var textStorage = [sceneDescriptionField textStorage];
var area = CPMakeRange(0, [textStorage length]);
var textStyle = @{@"CPFontAttributeName":[CPFont systemFontOfSize:12.0], @"CPForegroundColorAttributeName":[CPColor whiteColor]};
[textStorage removeAttribute:CPForegroundColorAttributeName range:area];
[textStorage addAttributes:textStyle range:area];

When ever I click on the CPTextView, in an area that does not contain any text, I get the following error in the console:

Uncaught Error: object cannot be nil (key: CPFontAttributeName)

Any thoughts on what's causing this?

Todd

daboe01

unread,
Oct 26, 2016, 1:30:39 AM10/26/16
to Cappuccino & Objective-J
looks like a bug.
can you post a reduction so i can have a look?

Todd Freese

unread,
Oct 26, 2016, 10:47:04 AM10/26/16
to Cappuccino & Objective-J
I'll work on a reduction later today.

Thanks

T

daboe01

unread,
Oct 26, 2016, 2:00:01 PM10/26/16
to Cappuccino & Objective-J
can you please try whether this PR fixes your issue?
Reply all
Reply to author
Forward
0 new messages