3

我已经看到了这个问题,但似乎没有人有一个通用的解决方案,我的。我的 3 个错误如下

<Error>: CGContextSaveGState: 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>: CGContextSetStyle: 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>: CGContextRestoreGState: 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.

我的应用程序仍然可以运行并且运行良好。但我想知道我是否应该担心或担心这一点。

仅供参考,我正在运行 Xcode 5.0.1,并且该应用程序设置为 iOS 7。我在 viewcontroller 上导致错误弹出的库是:

In the .h
#import <UIKit/UIKit.h>
#import "Event.h"
#import <MessageUI/MessageUI.h>
#import <EventKit/EventKit.h>
#import <EventKitUI/EventKitUI.h>

In the .m
#import "EventDetailsViewController.h"
#import "XMLReader.h"
#import <Twitter/Twitter.h>
#import "AppDelegate.h"
#import "FBShareViewController.h"
#import <MapKit/MapKit.h>

谢谢

4

2 回答 2

1

如果您尝试从 UIView 获取 UIImage,请确保您的 UIView 具有正确的框架集。它的高度或宽度不应为 0。

于 2015-05-22T08:46:14.683 回答
0

接受@Rob 的建议,我去寻找任何类似的方法,可悲的是,我调用了一个 drawRect 方法。我将其注释掉,运行代码,中提琴,运行没有任何错误。看起来它不会即时创建新的上下文,或者是我们必须处理的事情。

于 2013-11-11T17:15:21.477 回答