objective-c - 在 UITextView 中使用特定键盘的错误

标签 objective-c ios cocoa-touch uitextfield uitextview

我使用“单 View ”应用程序模板启动了一个 Xcode 项目,并向 viewDidLoad 中模板创建的 ViewController 类添加了两行:

UITextView *textView = [[UITextView alloc] initWithFrame:CGRectInset(self.view.bounds, 10, 10)];
[self.view addSubview:textView];

在模拟器中,我启用了“简体中文”“笔画”键盘。

当我使用 UITextView 时,切换到该键盘,然后触摸 ^_^ 键,控制台会出现以下错误:

<Error>: CGContextSaveGState: invalid context 0x0
<Error>: CGContextDrawLinearGradient: invalid context 0x0
<Error>: CGContextSetFillColorWithColor: invalid context 0x0
<Error>: CGContextFillRects: invalid context 0x0
<Error>: CGContextFillRects: invalid context 0x0
<Error>: CGContextSetFillColorWithColor: invalid context 0x0
<Error>: CGContextFillRects: invalid context 0x0
<Error>: CGContextSaveGState: invalid context 0x0
<Error>: CGContextDrawLinearGradient: invalid context 0x0
<Error>: CGContextSetFillColorWithColor: invalid context 0x0
<Error>: CGContextFillRects: invalid context 0x0
<Error>: CGContextFillRects: invalid context 0x0
<Error>: CGContextSetFillColorWithColor: invalid context 0x0
<Error>: CGContextFillRects: invalid context 0x0

这是一个错误吗?我应该担心吗?

最佳答案

我已经在 iOS 6.0 模拟器和运行 iOS 6.0.1 的 iPhone 4S 上重现了该错误,但在 iOS 5.0 模拟器中却没有发生。这是 iOS 6 中的一个错误。您应该在 http://bugreport.apple.com 上打开一个错误报告。 .

也就是说,它似乎并不是特别有害,所以我不会担心。

关于objective-c - 在 UITextView 中使用特定键盘的错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13352501/

相关文章:

ios - 如果语句没有被调用

ios - Swift 过滤器字典错误 : Cannot assign a value of type '[(_, _)]' to a value of type '[_ : _]'

ios - 我可以检测到iOS的“深色”设置吗?

iphone - 如何更改 UIImage 的饱和度?

ios - 为什么 AVSampleBufferDisplayLayer 停止显示从 AVCaptureVideoDataOutput 的委托(delegate)中获取的 CMSampleBuffers?

ios - 我应该重新设计这个实现还是可以动态地将单元格添加到 StaticTableViewController

iOS - 使用 NSNotificationCenter 的生命周期

iphone - 如何恢复所有那些好的旧 Xcode 功能?

iphone - 当 youtube 视频结束或按下完成按钮时 iOS 捕获事件

iphone - 重新加载/刷新 UIView