我用XCode 4.5.1更新了iOS 6.0 SDK,並且使用多字節鍵盤編輯UITextField時出現無效的上下文錯誤0x0。日本keybord)在我的應用程序。 以下是錯誤:'無效的上下文錯誤0x0',當使用iOS 6.0的多字節keybord編輯uitextfield時
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
我試圖創建新的項目,我有這些錯誤。 以下是新的項目代碼:
- (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;
}
如果你與我們的鍵盤編輯,你不會有錯誤。 你知道如何避免這個問題嗎?
謝謝,我明白了。 – terut