重新打开文档时,NSScrollview上的图层会导致严重错误

时间:2014-04-03 15:11:21

标签: objective-c cocoa layer nsscrollview nsdocument

我开始在我的scrollview / clipview上使用图层来获得更好的滚动行为并实现了这个网站上的提示:

http://www.jwilling.com/optimized-scrolling-in-nstableview/

使用CAScrollLayer作为NSClipView子类的层。

我对scrollview的文档视图是一个集合视图,它为每个项目都有自己的图层(可能会更改,我在项目视图上调用canDrawSubviewsIntoLayer)

嗯,这一切都正常,直到您使用X关闭文档,然后单击停靠栏图标或创建新文档。除了工具栏工作正常之外,除了毛躁之外没有任何显示。

我应该说我的第一部分是NSSplitview是scrollview,但没有任何内容可以显示。有时候我会得到错误日志,但是如果我在xCode中运行它,一切都会正常工作,如果导出到.app就会出现故障。

<Error>: CGContextGetCTM: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
 <Error>: CGContextGetBaseCTM: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
 <Error>: CGContextGetDefaultUserSpaceToDeviceSpaceTransform: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
<Error>: CGContextGetCTM: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
<Error>: CGContextGetBaseCTM: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
 <Error>: CGContextGetDefaultUserSpaceToDeviceSpaceTransform: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.

只有在ClipView或Scrollview确实有图层时才会出现此错误。它不是由CAScrollLayer引起的,因为即使我只是在其中任何一个上设置了setWantsLayer:YES,它也会发生。

你们有什么提示给我吗?因为我没有得到这个,只要你创建一个新文档(这基本上是一个包含所有collectionview内容的新窗口),应用程序就可以正常运行而没有错误,但不是第一次?

先谢谢你们。我不知道如何解决这个问题。

0 个答案:

没有答案