I am using a UITextField in my app. I am using [texfield becomeFirstResponder]
. This works just fine and loads the keyboard when the view is loaded. However, this error comes up when I click on the UITextField again after it has been brought up. I don't understand exactly why, but here is the output I am getting:
CGContextSetFillColorWithColor: invalid context 0x0.
CGContextSetStrokeColorWithColor: invalid context 0x0.
CGContextSaveGState: invalid context 0x0.
CGContextSetFlatness: invalid context 0x0.
CGContextAddPath: invalid context 0x0.
CGContextDrawPath: invalid context 0x0.
CGContextRestoreGState: invalid context 0x0.
CGContextSaveGState: invalid context 0x0.
CGContextSetFlatness: invalid context 0x0.
CGContextAddPath: invalid context 0x0.
CGContextDrawPath: invalid context 0x0.
CGContextRestoreGState: invalid context 0x0.
Here is my code:
// ViewController.h
@interface ViewController : UIViewController
@property (strong, nonatomic) IBOutlet UITextField *textField;
@end
// ViewController.m
@synthesize textField;
- (void)viewDidLoad
{
[textField becomeFirstResponder];
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}
I believe you've found an iOS bug (or at least a simulator bug). You can reproduce it even more simply:
I recommend opening a radar.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With