UItextView的NSUnknownKeyException

时间:2013-05-22 10:07:24

标签: iphone ios uitextview

我的代码:

@interface UITextView ()
- (id)styleString; // make compiler happy
@end

@interface MBTextView : UITextView

@end


#import "MBTextView.h"

@implementation MBTextView
- (id)styleString {
    return [[super styleString] stringByAppendingString:@"; line-height: 1.2em"];
}
@end

我打电话:

[MBTextView setValue:@"<b>big</b><br>blah blah" forKey:@"contentToHTMLString"];

它给我NSUnknownKeyException。但如果我只使用:

[UItextView setValue:@"<b>big</b><br>blah blah" forKey:@"contentToHTMLString"]; all is ok.what wrong with my code?

1 个答案:

答案 0 :(得分:0)

抱歉,这是我的错误:

[UItextView.text setValue:@"<b>big</b><br>blah blah" forKey:@"contentToHTMLString"]; 

我无法使用文字,抱歉