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?
objective-c ios6
terut
source share