'Invalid 0x0 context error' when editing uitextfield using a multibyte keyboard with iOS 6.0

I updated the iOS 6.0 SDK using Xcode 4.5.1, and I had an incorrect 0x0 contextual error while editing a UITextField with a multi-byte keyboard (like a Japanese keyboard) in my application. The following is a mistake:

Oct 9 21:46:44 example.com Example[2303] <Error>: CGContextSaveGState: invalid context 0x0 Oct 9 21:46:44 example.com Example[2303] <Error>: CGContextDrawLinearGradient: invalid context 0x0 Oct 9 21:46:44 example.com Example[2303] <Error>: CGContextSetFillColorWithColor: invalid context 0x0 Oct 9 21:46:44 example.com Example[2303] <Error>: CGContextFillRects: invalid context 0x0 Oct 9 21:46:44 example.com Example[2303] <Error>: CGContextFillRects: invalid context 0x0 Oct 9 21:46:44 example.com Example[2303] <Error>: CGContextSetFillColorWithColor: invalid context 0x0 Oct 9 21:46:44 example.com Example[2303] <Error>: CGContextFillRects: invalid context 0x0 Oct 9 21:46:44 example.com Example[2303] <Error>: CGContextSaveGState: invalid context 0x0 Oct 9 21:46:44 example.com Example[2303] <Error>: CGContextDrawLinearGradient: invalid context 0x0 Oct 9 21:46:44 example.com Example[2303] <Error>: CGContextSetFillColorWithColor: invalid context 0x0 Oct 9 21:46:44 example.com Example[2303] <Error>: CGContextFillRects: invalid context 0x0 Oct 9 21:46:44 example.com Example[2303] <Error>: CGContextFillRects: invalid context 0x0 Oct 9 21:46:44 example.com Example[2303] <Error>: CGContextSetFillColorWithColor: invalid context 0x0 Oct 9 21:46:44 example.com Example[2303] <Error>: CGContextFillRects: invalid context 0x0 

I tried to create a new project, and I had these errors. Below is the new project code:

 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; // Override point for customization after application launch. self.window.backgroundColor = [UIColor whiteColor]; [self.window makeKeyAndVisible]; UITextField *foo = [[UITextField alloc] initWithFrame:CGRectMake(30, 30, 200, 50)]; [self.window addSubview:foo]; return YES; } 

if you are editing using the US keyboard, you will not have errors. Do you know how to avoid this problem?

+8
objective-c ios6
source share
2 answers

Looks like an error in iOS 6 (a similar question here earlier): Error using a specific keyboard with UITextView )

+2
source share

This error can be traced to double-click on an empty whitefield. This is a bug in iOS. Initiate your text box to "" and the error will disappear.

+1
source share

All Articles